diff --git a/module/project/model.php b/module/project/model.php index 3231360439..9e38401331 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2187,6 +2187,20 @@ class projectModel extends model if($task->status != 'cancel' and $task->status != 'closed') $hour->totalLeft += $task->left; } $hours[$executionID] = $hour; + + if($executions[$executionID]->type == 'stage' and $executions[$executionID]->grade == 2) + { + $stageParent = $executions[$executionID]->parent; + if(!isset($hours[$stageParent])) + { + $hours[$stageParent] = clone $hour; + continue; + } + + $hours[$stageParent]->totalEstimate += $hour->totalEstimate; + $hours[$stageParent]->totalConsumed += $hour->totalConsumed; + $hours[$stageParent]->totalLeft += $hour->totalLeft; + } } /* Compute totalReal and progress. */