This commit is contained in:
Adrian Hopek
2022-03-01 12:41:07 +01:00
parent 37c08f3823
commit 730b0f9adb
2 changed files with 6 additions and 2 deletions

View File

@@ -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