ItEr46S04ValidacionEProbasFuncionaisItEr45S04: Fixing problem.

When activating recommended allocation and the calculated value is not
resources per day it kept the previous resources per day value. Now it
is reset to zero.
This commit is contained in:
Óscar González Fernández 2010-02-08 13:53:40 +01:00
parent a3ccebfbc3
commit 106a3458a2

View file

@ -539,10 +539,18 @@ public class FormBinder {
allHoursInputChange);
allResourcesPerDay.addEventListener(Events.ON_CHANGE,
allResourcesPerDayChange);
sumResourcesPerDayFromRowsAndAssignToAllResourcesPerDay();
sumResourcesPerDayOrSetToZero();
Util.reloadBindings(allocationsGrid);
}
private void sumResourcesPerDayOrSetToZero() {
if (allResourcesPerDay.isDisabled()) {
sumResourcesPerDayFromRowsAndAssignToAllResourcesPerDay();
} else {
allResourcesPerDay.setValue(BigDecimal.ZERO);
}
}
private void distributeHoursFromTotalToRows() {
Integer value = allHoursInput.getValue();
value = value != null ? value : 0;