OrderElement orderElement = taskElement.getOrderElement();
if (orderElement == null) {
return BigDecimal.ZERO;
}
EffortDuration totalChargedEffort = orderElement
.getSumChargedEffort() != null ? orderElement
.getSumChargedEffort().getTotalChargedEffort()
: EffortDuration.zero();
EffortDuration estimatedEffort = taskElement.getSumOfAssignedEffort();
if(estimatedEffort.isZero()) {
estimatedEffort = EffortDuration.hours(orderElement.getWorkHours());
if(estimatedEffort.isZero()) {
return BigDecimal.ZERO;
}
}
return new BigDecimal(totalChargedEffort.divivedBy(
estimatedEffort).doubleValue()).setScale(2,