[Bug #1138] Fix bug
In the case that the interval was the same as the task and the start was in the middle of a day, some hours were being losed. FEA: ItEr75S04BugFixing
This commit is contained in:
parent
2d96c15d73
commit
edbf0dae6d
1 changed files with 24 additions and 0 deletions
|
|
@ -2002,6 +2002,8 @@ public abstract class ResourceAllocation<T extends DayAssignment> extends
|
|||
List<? extends DayAssignment> assignments,
|
||||
final IntraDayDate startInclusive, final IntraDayDate endExclusive) {
|
||||
|
||||
final IntraDayDate allocationStart = getIntraDayStartDate();
|
||||
|
||||
return EffortDuration.sum(assignments,
|
||||
new IEffortFrom<DayAssignment>() {
|
||||
|
||||
|
|
@ -2030,6 +2032,28 @@ public abstract class ResourceAllocation<T extends DayAssignment> extends
|
|||
result = new PartialDay(result.getStart(),
|
||||
endExclusive);
|
||||
}
|
||||
return adjustPartialDayToAllocationStart(result);
|
||||
}
|
||||
|
||||
// if the start of the allocation is in the middle of a day,
|
||||
// its work also starts later; so the PartialDay must be
|
||||
// moved to earlier so it doesn't limit the duration more
|
||||
// that it should
|
||||
private PartialDay adjustPartialDayToAllocationStart(
|
||||
PartialDay day) {
|
||||
PartialDay result = day;
|
||||
if (allocationStart.areSameDay(day.getDate())) {
|
||||
EffortDuration substractingAtStart = day.getStart()
|
||||
.getEffortDuration();
|
||||
EffortDuration newSubstractionAtStart = substractingAtStart
|
||||
.minus(EffortDuration
|
||||
.min(substractingAtStart,
|
||||
allocationStart
|
||||
.getEffortDuration()));
|
||||
IntraDayDate newStart = IntraDayDate.create(
|
||||
day.getDate(), newSubstractionAtStart);
|
||||
result = new PartialDay(newStart, day.getEnd());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue