diff --git a/model/facade/action/GetHolidayHoursBaseAction.php b/model/facade/action/GetHolidayHoursBaseAction.php index 4c5bfc799..52a79b5a2 100644 --- a/model/facade/action/GetHolidayHoursBaseAction.php +++ b/model/facade/action/GetHolidayHoursBaseAction.php @@ -138,13 +138,13 @@ protected function getHoursSummary(DateTime $referenceDate = NULL): array //if the reference data is in the future, then usedHours has to be 0 - we are not time travelers if($referenceDate > new DateTime()){ $userUsedHours[$userVO->getLogin()] = 0; + $userScheduledHours[$userVO->getLogin()] = $vacations; } else { + //need to do this because we need to get hours for interval $userUsedHours[$userVO->getLogin()] = $taskDao->getVacations($userVO, $reportInit, $referenceDate)["add_hours"] ?? 0; + $userScheduledHours[$userVO->getLogin()] = $vacations - $userUsedHours[$userVO->getLogin()]; } - - $userScheduledHours[$userVO->getLogin()] = $vacations - $userUsedHours[$userVO->getLogin()]; - // The difference is the number of pending holiday hours $userPendingHolidayHours[$userVO->getLogin()] = $holidayHours - $vacations; } diff --git a/model/facade/action/GetHolidaySummaryReportAction.php b/model/facade/action/GetHolidaySummaryReportAction.php index 7549dde5d..98e8ed59e 100644 --- a/model/facade/action/GetHolidaySummaryReportAction.php +++ b/model/facade/action/GetHolidaySummaryReportAction.php @@ -93,7 +93,7 @@ protected function doExecute() 'availableHours' => round($summary['availableHours'][$this->user->getLogin()], 2), 'usedHours' => round($usedHours, 2), 'pendingHours' => round($summary['pendingHours'][$this->user->getLogin()], 2), - 'plannedHours' => round($summary['usedHours'][$this->user->getLogin()], 2), + 'scheduledHours' => round($summary['scheduledHours'][$this->user->getLogin()] - $usedHours, 2), 'percentage' => $summary['availableHours'][$this->user->getLogin()] ? round(($summary['usedHours'][$this->user->getLogin()] / $summary['availableHours'][$this->user->getLogin()]) * 100, 2) : 0, 'hoursDay' => $validJourney, 'holidays' => $leaves, diff --git a/web/holidaySummary.php b/web/holidaySummary.php index 4e78323ab..517c5bf83 100644 --- a/web/holidaySummary.php +++ b/web/holidaySummary.php @@ -76,7 +76,7 @@