ItEr20S04ArquitecturaServidorItEr19S04: Fixed division by 0 problem rendering an HoursGroup.

This commit is contained in:
Manuel Rego Casasnovas 2009-08-04 11:30:23 +02:00 committed by Óscar González Fernández
parent afc34299de
commit fbed099f01

View file

@ -434,6 +434,9 @@ public class OrderElementController extends GenericForwardComposer {
BigDecimal total = new BigDecimal(model
.getOrderElement()
.getWorkHours()).setScale(2);
if (total.equals(new BigDecimal(0).setScale(2))) {
return new BigDecimal(0).setScale(2);
}
return workingHours.divide(total,
BigDecimal.ROUND_DOWN);
}