1 Commits

Author SHA1 Message Date
3bea1f41b2 - duplication of code removed 2022-07-11 13:11:15 +02:00

View File

@@ -105,11 +105,10 @@ class UserVacationStatsRetriever
public function hasVacationDaysLimit(User $user, YearPeriod $yearPeriod): bool public function hasVacationDaysLimit(User $user, YearPeriod $yearPeriod): bool
{ {
$limit = $user->vacationLimits() return $user->vacationLimits()
->whereBelongsTo($yearPeriod) ->whereBelongsTo($yearPeriod)
->first()?->days; ->first()
?->hasVacation() ?? false;
return $limit !== null;
} }
protected function getLimitableVacationTypes(): Collection protected function getLimitableVacationTypes(): Collection