[Bug #1304] Don't use the cached value sumOfHoursAllocated when drawing the
progress bars of tasks. This unupdated cached value is causing the bug. We will use it only in company view, where allocations can't change. FEA: ItEr75S04BugFixing
This commit is contained in:
parent
922f5cbdf6
commit
6f42487437
2 changed files with 15 additions and 1 deletions
|
|
@ -670,6 +670,14 @@ public abstract class TaskElement extends BaseEntity {
|
|||
return sumOfHoursAllocated;
|
||||
}
|
||||
|
||||
public Integer getSumOfHoursAllocatedCalculated() {
|
||||
int result = 0;
|
||||
for(ResourceAllocation<?> allocation : getAllResourceAllocations()) {
|
||||
result += allocation.getAssignedHours();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return super.toString() + " :: " + getName();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -640,7 +640,13 @@ public class TaskElementAdapter {
|
|||
private GanttDate getAdvanceEndDate(BigDecimal advancePercentage) {
|
||||
Integer hours = Integer.valueOf(0);
|
||||
if (taskElement.getOrderElement() != null) {
|
||||
hours = taskElement.getSumOfHoursAllocated();
|
||||
if(taskElement.getParent() == null){
|
||||
//it's an order, we use the cached value
|
||||
hours = taskElement.getSumOfHoursAllocated();
|
||||
}
|
||||
else {
|
||||
hours = taskElement.getSumOfHoursAllocatedCalculated();
|
||||
}
|
||||
}
|
||||
|
||||
if (taskElement instanceof TaskGroup) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue