ItEr49S04ValidacionEProbasFuncionaisItEr48S04: [Bug #361] Fixed bug using hours from DayAssignments instead of OrderElements in order to calculate advance end date.

This commit is contained in:
Manuel Rego Casasnovas 2010-03-02 17:31:39 +01:00 committed by Javier Moran Rua
parent 90d61a0bb5
commit ffb9761a6f
2 changed files with 11 additions and 1 deletions

View file

@ -419,4 +419,14 @@ public abstract class TaskElement extends BaseEntity {
public abstract boolean isMilestone();
public Integer getTotalHoursAssigned() {
int result = 0;
for (ResourceAllocation<?> resourceAllocation : getSatisfiedResourceAllocations()) {
for (DayAssignment each : resourceAllocation.getAssignments()) {
result += each.getHours();
}
}
return result;
}
}

View file

@ -266,7 +266,7 @@ public class TaskElementAdapter implements ITaskElementAdapter {
if (orderElement != null) {
advancePercentage = orderElement
.getAdvancePercentage();
hours = orderElement.getWorkHours();
hours = taskElement.getTotalHoursAssigned();
} else {
advancePercentage = new BigDecimal(0);
hours = Integer.valueOf(0);