Fix bug in getHoursInGapUntilAllocatingAndGoingToTheEnd(), don't add 0 hour days if the total number of hours to allocate were already completed
FEA: ItEr66OTS08CorreccionsRecursosLimitantesItEr65OTS04
This commit is contained in:
parent
f92ff825ea
commit
b4de7e098e
1 changed files with 8 additions and 2 deletions
|
|
@ -184,9 +184,15 @@ public class Gap implements Comparable<Gap> {
|
|||
while (daysUntilEnd.hasNext()) {
|
||||
PartialDay each = daysUntilEnd.next();
|
||||
int hoursAtDay = calendar.getCapacityOn(each).roundToHours();
|
||||
int hours = Math.min(hoursAtDay, total);
|
||||
int hours = Math.min(hoursAtDay, total);
|
||||
total -= hours;
|
||||
result.add(hours);
|
||||
|
||||
// Don't add hours when total and hours are zero (it'd be like
|
||||
// adding an extra 0 hour day when total is completed)
|
||||
if (total != 0 || hours != 0) {
|
||||
result.add(hours);
|
||||
}
|
||||
|
||||
if (total == 0
|
||||
&& DateAndHour.from(each.getDate())
|
||||
.compareTo(allocationEnd) >= 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue