This commit is contained in:
Adrian Hopek
2022-03-07 11:31:34 +01:00
parent 3a1b9862c1
commit 5d64ad9d2a
7 changed files with 41 additions and 43 deletions

View File

@@ -24,8 +24,8 @@ use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use Toby\Domain\Enums\VacationRequestState;
use Toby\Domain\Enums\VacationType;
use Toby\Domain\States\VacationRequest\Approved;
use Toby\Eloquent\Models\Holiday;
use Toby\Eloquent\Models\User;
use Toby\Eloquent\Models\Vacation;
@@ -189,7 +189,7 @@ class TimesheetPerUserSheet implements WithTitle, WithHeadings, WithEvents, With
return $user->vacations()
->with("vacationRequest")
->whereBetween("date", [$period->start, $period->end])
->whereRelation("vacationRequest", "state", VacationRequestState::Approved->value)
->whereRelation("vacationRequest", "state", Approved::$name)
->get()
->groupBy(
[

View File

@@ -48,7 +48,7 @@ class VacationRequestStatesRetriever
];
}
public static function filterByStatus(string $filter): array
public static function filterByStatusGroup(string $filter): array
{
return match ($filter) {
"pending" => self::pendingStates(),