Revert "[Bug #1319] Change division method of EffortDuration"

This reverts commit 395d6a2f5e.
This commit is contained in:
Manuel Rego Casasnovas 2012-01-02 11:11:49 +01:00
parent 4beea48158
commit 954a45b1d6

View file

@ -522,10 +522,9 @@ public class TaskElementAdapter {
return getBeginDate();
}
}
BigDecimal percentage = new BigDecimal(assignedEffort
.divivedBy(effort).doubleValue()).setScale(2,
RoundingMode.HALF_UP);
BigDecimal percentage = assignedEffort
.toHoursAsDecimalWithScale(2).divide(
new BigDecimal(hours), RoundingMode.DOWN);
result = calculateLimitDateByPercentage(percentage);
}
@ -544,6 +543,8 @@ public class TaskElementAdapter {
.getSumChargedEffort() != null ? orderElement
.getSumChargedEffort().getTotalChargedEffort()
: EffortDuration.zero();
BigDecimal assignedHours = totalChargedEffort
.toHoursAsDecimalWithScale(2);
BigDecimal estimatedHours = new BigDecimal(
taskElement.getSumOfHoursAllocated()).setScale(2);
@ -555,9 +556,7 @@ public class TaskElementAdapter {
return BigDecimal.ZERO;
}
}
return new BigDecimal(totalChargedEffort.divivedBy(
estimatedEffort).doubleValue()).setScale(2,
RoundingMode.HALF_UP);
return assignedHours.divide(estimatedHours, RoundingMode.DOWN);
}
@Override