From 730b0f9adb3346f932211394b663fe9cf6cf4905 Mon Sep 17 00:00:00 2001 From: Adrian Hopek Date: Tue, 1 Mar 2022 12:41:07 +0100 Subject: [PATCH] #43 - fix --- app/Domain/UserVacationStatsRetriever.php | 6 +++++- resources/js/Pages/VacationRequest/Create.vue | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Domain/UserVacationStatsRetriever.php b/app/Domain/UserVacationStatsRetriever.php index 830a3cd..8a1d55f 100644 --- a/app/Domain/UserVacationStatsRetriever.php +++ b/app/Domain/UserVacationStatsRetriever.php @@ -61,7 +61,11 @@ class UserVacationStatsRetriever public function getRemainingVacationDays(User $user, YearPeriod $yearPeriod): int { - return $this->getVacationDaysLimit($user, $yearPeriod) - $this->getUsedVacationDays($user, $yearPeriod); + $limit = $this->getVacationDaysLimit($user, $yearPeriod); + $used = $this->getUsedVacationDays($user, $yearPeriod); + $pending = $this->getPendingVacationDays($user, $yearPeriod); + + return $limit - $used - $pending; } public function getVacationDaysLimit(User $user, YearPeriod $yearPeriod): int diff --git a/resources/js/Pages/VacationRequest/Create.vue b/resources/js/Pages/VacationRequest/Create.vue index ce862e3..72c459d 100644 --- a/resources/js/Pages/VacationRequest/Create.vue +++ b/resources/js/Pages/VacationRequest/Create.vue @@ -40,7 +40,7 @@