[Bug #1242] Return end date directly when calculating advance and percentage is 100%.

In that case, no calculations are needed, and since the algorithm has some
defects we avoid them.

FEA: ItEr75S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2011-12-29 15:53:56 +01:00
parent 7518270ced
commit 13389197d9

View file

@ -568,6 +568,9 @@ public class TaskElementAdapter {
BigDecimal percentage = new BigDecimal(assignedEffort
.divivedBy(effort).doubleValue()).setScale(2,
RoundingMode.HALF_UP);
if (percentage.compareTo(BigDecimal.ONE) == 0) {
return getEndDate();
}
result = calculateLimitDateByPercentage(percentage);
@ -637,6 +640,10 @@ public class TaskElementAdapter {
}
private GanttDate getAdvanceEndDate(BigDecimal advancePercentage) {
if (advancePercentage.compareTo(BigDecimal.ONE) == 0) {
return getEndDate();
}
BigDecimal hours = BigDecimal.ZERO;
if (taskElement instanceof TaskGroup) {