* Fix bug#25004.

This commit is contained in:
xieqiyu
2022-07-27 21:38:28 +08:00
parent cd8247954c
commit 0ec68feb10
4 changed files with 37 additions and 31 deletions
+2 -2
View File
@@ -1434,14 +1434,14 @@ class programModel extends model
}
/* Compute totalReal and progress. */
$this->loadModel('project');
$progressList = $this->loadModel('project')->getWaterfallProgress(array_keys($hours));
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 = $projects[$projectID]->model == 'waterfall' ? $this->project->getWaterfallProgress($projectID) : ($hour->totalReal ? round($hour->totalConsumed / $hour->totalReal, 2) * 100 : 0);
$hour->progress = $projects[$projectID]->model == 'waterfall' ? $progressList[$projectID] : ($hour->totalReal ? round($hour->totalConsumed / $hour->totalReal, 2) * 100 : 0);
}
/* Get the number of left tasks. */