[Bug #908] Total amount of allocated hours miscalculated in lineal interpolation (Streches function)
As the end is exclusive, it's needed to increment the endDate in one day for the last Stretch FEA: ItEr72S04BugFixing
This commit is contained in:
parent
189fa05338
commit
475f5c7c0f
1 changed files with 8 additions and 4 deletions
|
|
@ -255,11 +255,15 @@ public class StretchesFunction extends AssignmentFunction {
|
|||
}
|
||||
|
||||
private void apply(ResourceAllocation<?> resourceAllocation,
|
||||
LocalDate startInclusive, LocalDate endExclusive,
|
||||
LocalDate startInclusive, LocalDate taskEnd,
|
||||
int intervalHours) {
|
||||
// End has to be exclusive on last Stretch
|
||||
LocalDate endDate = getEnd();
|
||||
if (endDate.equals(taskEnd)) {
|
||||
endDate = endDate.plusDays(1);
|
||||
}
|
||||
resourceAllocation.withPreviousAssociatedResources()
|
||||
.onIntervalWithinTask(getStartFor(startInclusive),
|
||||
getEnd())
|
||||
.onIntervalWithinTask(getStartFor(startInclusive), endDate)
|
||||
.allocateHours(intervalHours);
|
||||
}
|
||||
|
||||
|
|
@ -279,7 +283,7 @@ public class StretchesFunction extends AssignmentFunction {
|
|||
interval.apply(allocation, allocationStart, allocationEnd,
|
||||
hoursPerInterval[i++]);
|
||||
}
|
||||
|
||||
Validate.isTrue(totalHours == allocation.getAssignedHours());
|
||||
}
|
||||
|
||||
private static int[] getHoursPerInterval(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue