Skip to content

Commit

Permalink
Use scheduled hours instead of used for percentage
Browse files Browse the repository at this point in the history
Used hours are only for scheduled hours that are in the past. To
calculate percentage it is needed to use all the scheduled hours for
the period instead.
  • Loading branch information
anarute committed May 8, 2024
1 parent 09347e0 commit 6fdca52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model/facade/action/GetHolidaySummaryReportAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected function doExecute()
'usedHours' => round($usedHours, 2),
'pendingHours' => round($summary['pendingHours'][$this->user->getLogin()], 2),
'scheduledHours' => round($summary['scheduledHours'][$this->user->getLogin()] - $usedHours, 2),
'percentage' => $summary['availableHours'][$this->user->getLogin()] ? round(($usedHours / $summary['availableHours'][$this->user->getLogin()]) * 100, 2) : 0,
'percentage' => $summary['availableHours'][$this->user->getLogin()] ? round(($summary['scheduledHours'][$this->user->getLogin()] / $summary['availableHours'][$this->user->getLogin()]) * 100, 2) : 0,
'hoursDay' => $validJourney,
'holidays' => $leaves,
];
Expand Down

0 comments on commit 6fdca52

Please sign in to comment.