Fix bug orderElement.getSumChargedHours() returned null caused runtime

error

FEA: ItEr60S04ValidacionEProbasFuncionaisItEr59S04
This commit is contained in:
Diego Pino Garcia 2010-09-07 12:51:42 +02:00
parent b9c04d5d90
commit d1a1cba1ab

View file

@ -181,8 +181,9 @@ public class OrderElementDAO extends IntegrationEntityDAO<OrderElement>
@Override
@Transactional(readOnly = true)
public BigDecimal getHoursAdvancePercentage(OrderElement orderElement) {
BigDecimal assignedHours = new BigDecimal(orderElement
.getSumChargedHours().getTotalChargedHours()).setScale(2);
final Integer totalChargedHours = orderElement.getSumChargedHours() != null ? orderElement
.getSumChargedHours().getTotalChargedHours() : new Integer(0);
BigDecimal assignedHours = new BigDecimal(totalChargedHours).setScale(2);
BigDecimal estimatedHours = new BigDecimal(orderElement.getWorkHours())
.setScale(2);