diff --git a/app/Domain/TimesheetPerUserSheet.php b/app/Domain/TimesheetPerUserSheet.php index 56a0a291..2649ade7 100644 --- a/app/Domain/TimesheetPerUserSheet.php +++ b/app/Domain/TimesheetPerUserSheet.php @@ -25,7 +25,6 @@ use PhpOffice\PhpSpreadsheet\Style\Fill; use PhpOffice\PhpSpreadsheet\Style\NumberFormat; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; -use Toby\Enums\VacationType; use Toby\Models\Holiday; use Toby\Models\User; use Toby\Models\Vacation; @@ -121,7 +120,7 @@ public function generator(): Generator $workedThisDay ? static::HOURS_PER_DAY : null, ]; - foreach (VacationType::cases() as $type) { + foreach ($this->types as $type) { $row[] = $vacationsForDay->has($type->value) ? static::HOURS_PER_DAY : null; } diff --git a/app/Enums/VacationType.php b/app/Enums/VacationType.php index bf6b231c..2e1724d4 100644 --- a/app/Enums/VacationType.php +++ b/app/Enums/VacationType.php @@ -9,7 +9,6 @@ enum VacationType: string { case RemoteWork = "remote_work"; - case Absence = "absence"; case Vacation = "vacation"; case Sick = "sick_vacation"; case Special = "special_vacation"; @@ -20,6 +19,7 @@ enum VacationType: string case Training = "training_vacation"; case Childcare = "childcare_vacation"; case Volunteering = "volunteering_vacation"; + case Absence = "absence"; public static function casesToSelect(): array {