Fix problem with EffortDuration in CalculateFinishedTasksEstimationDeviationVisitor
FEA: ItEr76S04BugFixing
This commit is contained in:
parent
2a35c60b59
commit
54835bce69
1 changed files with 12 additions and 3 deletions
|
|
@ -64,9 +64,18 @@ public class CalculateFinishedTasksEstimationDeviationVisitor extends TaskElemen
|
|||
EffortDuration spentEffort = sumChargedEffort == null ? EffortDuration
|
||||
.zero() : sumChargedEffort.getTotalChargedEffort();
|
||||
if (!spentEffort.isZero()) {
|
||||
deviations.add(spentEffort.minus(effort)
|
||||
.dividedByAndResultAsBigDecimal(effort)
|
||||
.doubleValue() * 100);
|
||||
double deviation;
|
||||
if (spentEffort.compareTo(effort) >= 0) {
|
||||
deviation = spentEffort.minus(effort)
|
||||
.dividedByAndResultAsBigDecimal(effort)
|
||||
.doubleValue();
|
||||
} else {
|
||||
deviation = -effort.minus(spentEffort)
|
||||
.dividedByAndResultAsBigDecimal(effort)
|
||||
.doubleValue();
|
||||
|
||||
}
|
||||
deviations.add(deviation * 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue