* Fix bug#25004.

This commit is contained in:
xieqiyu
2022-07-27 13:31:48 +08:00
parent 61babc61a5
commit cd8247954c
4 changed files with 48 additions and 5 deletions

View File

@@ -1434,13 +1434,14 @@ class programModel extends model
}
/* Compute totalReal and progress. */
foreach($hours as $hour)
$this->loadModel('project');
foreach($hours as $projectID => $hour)
{
$hour->totalEstimate = round($hour->totalEstimate, 1) ;
$hour->totalConsumed = round($hour->totalConsumed, 1);
$hour->totalLeft = round($hour->totalLeft, 1);
$hour->totalReal = $hour->totalConsumed + $hour->totalLeft;
$hour->progress = $hour->totalReal ? round($hour->totalConsumed / $hour->totalReal, 2) * 100 : 0;
$hour->progress = $projects[$projectID]->model == 'waterfall' ? $this->project->getWaterfallProgress($projectID) : ($hour->totalReal ? round($hour->totalConsumed / $hour->totalReal, 2) * 100 : 0);
}
/* Get the number of left tasks. */