#39 - generate timesheet #56

Merged
Baakoma merged 9 commits from #39-generate-timesheet into main 2022-02-21 16:09:45 +01:00
10 changed files with 1104 additions and 168 deletions
Showing only changes of commit de05798e06 - Show all commits

View File

@@ -29,7 +29,7 @@ class CalendarGenerator
return $this->generateCalendar($period, $holidays);
}
protected function monthNameToNumber($name): int
protected function monthNameToNumber(string $name): int
{
return match ($name) {
default => CarbonInterface::JANUARY,

View File

@@ -0,0 +1,40 @@
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
<?php
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
declare(strict_types=1);
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
namespace Toby\Domain;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
use Illuminate\Database\Eloquent\Collection;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
use Illuminate\Support\Carbon;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
class TimesheetExport implements WithMultipleSheets
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
{
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
protected Collection $users;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
protected Carbon $month;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
public function sheets(): array
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
{
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
$sheets = [];
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
foreach ($this->users as $user) {
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
$sheets[] = new TimesheetPerUserSheet($user, $this->month);
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
}
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
return $sheets;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
}
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
public function forUsers(Collection $users): static
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
{
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
$this->users = $users;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
return $this;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
}
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
public function forMonth(Carbon $month): static
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
{
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
$this->month = $month;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
return $this;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
}
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
}
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?

View File

@@ -0,0 +1,216 @@
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
<?php
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
declare(strict_types=1);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
namespace Toby\Domain;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Carbon\CarbonInterface;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Carbon\CarbonPeriod;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Generator;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Illuminate\Support\Carbon;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Illuminate\Support\Collection;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\FromGenerator;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\RegistersEventListeners;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithEvents;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithHeadings;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithStrictNullComparison;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithStyles;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithTitle;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Events\AfterSheet;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Shared\Date;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Style\Alignment;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Style\Border;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Style\Fill;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Domain\Enums\VacationRequestState;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Domain\Enums\VacationType;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Eloquent\Models\Holiday;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Eloquent\Models\User;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Eloquent\Models\Vacation;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
class TimesheetPerUserSheet implements WithTitle, WithHeadings, WithEvents, WithStyles, WithStrictNullComparison, ShouldAutoSize, FromGenerator
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use RegistersEventListeners;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected const HOURS_PER_DAY = 8;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function __construct(
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected User $user,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected Carbon $month,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function title(): string
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $this->user->fullName;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function headings(): array
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$types = VacationType::cases();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$headings = [
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Date"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Day of week"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Start date"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("End date"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Worked hours"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
];
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
foreach ($types as $type) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$headings[] = $type->label();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $headings;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function generator(): Generator
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$period = CarbonPeriod::create($this->month->copy()->startOfMonth(), $this->month->copy()->endOfMonth());
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$vacations = $this->getVacationsForPeriod($this->user, $period);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$holidays = $this->getHolidaysForPeriod($period);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
foreach ($period as $day) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$vacationsForDay = $vacations->get($day->toDateString(), new Collection());
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$workedThisDay = $this->checkIfWorkedThisDay($day, $holidays, $vacationsForDay);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$row = [
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
Date::dateTimeToExcel($day),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$day->translatedFormat("l"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$workedThisDay ? $this->toExcelTime(Carbon::createFromTime(8)) : null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$workedThisDay ? $this->toExcelTime(Carbon::createFromTime(16)) : null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$workedThisDay ? static::HOURS_PER_DAY : null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
];
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
foreach (VacationType::cases() as $type) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$row[] = $vacationsForDay->has($type->value) ? static::HOURS_PER_DAY : null;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
yield $row;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function styles(Worksheet $sheet): void
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$lastRow = $sheet->getHighestRow();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$lastColumn = $sheet->getHighestColumn();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A1:{$lastColumn}1")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFont()->setBold(true);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A1:{$lastColumn}1")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAlignment()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setVertical(Alignment::VERTICAL_CENTER);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A1:{$lastColumn}1")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFill()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setFillType(Fill::FILL_SOLID)
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getStartColor()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setRGB("D9D9D9");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("C1:{$lastColumn}{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAlignment()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setHorizontal(Alignment::HORIZONTAL_CENTER);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A2:A{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getNumberFormat()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setFormatCode(NumberFormat::FORMAT_DATE_DDMMYYYY);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("C1:D{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getNumberFormat()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setFormatCode(NumberFormat::FORMAT_DATE_TIME3);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A2:A{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFont()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setBold(true);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
for ($i = 2; $i < $lastRow; $i++) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$date = Date::excelToDateTimeObject($sheet->getCell("A{$i}")->getValue());
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
if (Carbon::createFromInterface($date)->isWeekend()) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A{$i}:{$lastColumn}{$i}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFill()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setFillType(Fill::FILL_SOLID)
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getStartColor()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setRGB("FEE2E2");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A1:{$lastColumn}{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getBorders()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAllBorders()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setBorderStyle(Border::BORDER_THIN);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public static function afterSheet(AfterSheet $event): void
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet = $event->getSheet();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$lastRow = $sheet->getDelegate()->getHighestRow();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->append([
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Sum:"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
"=SUM(E2:E{$lastRow})",
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
]);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$lastRow++;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->getStyle("A{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAlignment()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setHorizontal(Alignment::HORIZONTAL_RIGHT);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->getStyle("A{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFont()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setBold(true);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->getStyle("E{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAlignment()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setHorizontal(Alignment::HORIZONTAL_CENTER);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->mergeCells("A{$lastRow}:D{$lastRow}");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->getStyle("A{$lastRow}:E{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getBorders()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAllBorders()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setBorderStyle(Border::BORDER_THIN);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected function getVacationsForPeriod(User $user, CarbonPeriod $period): Collection
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $user->vacations()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->with("vacationRequest")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->whereBetween("date", [$period->start, $period->end])
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->whereRelation("vacationRequest", "state", VacationRequestState::Approved->value)
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->get()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->groupBy(
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
[
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
fn(Vacation $vacation) => $vacation->date->toDateString(),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
fn(Vacation $vacation) => $vacation->vacationRequest->type->value,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
],
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected function getHolidaysForPeriod(CarbonPeriod $period): Collection
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return Holiday::query()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->whereBetween("date", [$period->start, $period->end])
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->pluck("date");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected function toExcelTime(Carbon $time): float
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$excelTimestamp = Date::dateTimeToExcel($time);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$excelDate = floor($excelTimestamp);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $excelTimestamp - $excelDate;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected function checkIfWorkedThisDay(CarbonInterface $day, Collection $holidays, Collection $vacations): bool
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $day->isWeekday() && $holidays->doesntContain($day) && $vacations->isEmpty();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?

View File

@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Http\Controllers;
use Carbon\CarbonInterface;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
use Maatwebsite\Excel\Facades\Excel;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Toby\Domain\TimesheetExport;
use Toby\Eloquent\Helpers\YearPeriodRetriever;
use Toby\Eloquent\Models\User;
class TimesheetController extends Controller
{
public function __invoke(Request $request, YearPeriodRetriever $yearPeriodRetriever): BinaryFileResponse
{
$yearPeriod = $yearPeriodRetriever->selected();
$month = Str::lower($request->query("month", Carbon::now()->englishMonth));
$month = Carbon::create($yearPeriod->year, $this->monthNameToNumber($month));
$users = User::query()
->orderBy("last_name")
->orderBy("first_name")
->get();
$filename = "{$month->translatedFormat("F Y")}.xlsx";
$timesheet = (new TimesheetExport())
->forMonth($month)
->forUsers($users);
return Excel::download($timesheet, $filename);
}
protected function monthNameToNumber(string $name): int
{
return match ($name) {
default => CarbonInterface::JANUARY,
"february" => CarbonInterface::FEBRUARY,
"march" => CarbonInterface::MARCH,
"april" => CarbonInterface::APRIL,
"may" => CarbonInterface::MAY,
"june" => CarbonInterface::JUNE,
"july" => CarbonInterface::JULY,
"august" => CarbonInterface::AUGUST,
"september" => CarbonInterface::SEPTEMBER,
"october" => CarbonInterface::OCTOBER,
"november" => CarbonInterface::NOVEMBER,
"december" => CarbonInterface::DECEMBER,
};
}
}

View File

@@ -18,6 +18,7 @@
"laravel/telescope": "^4.6",
"laravel/tinker": "^2.5",
"lasserafn/php-initial-avatar-generator": "^4.2",
"maatwebsite/excel": "^3.1",
"spatie/laravel-google-calendar": "^3.5"
},
"require-dev": {

823
composer.lock generated

File diff suppressed because it is too large Load Diff

103
config/excel.php Normal file
View File

@@ -0,0 +1,103 @@
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
<?php
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
declare(strict_types=1);
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
use Maatwebsite\Excel\Excel;
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
return [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"exports" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"chunk_size" => 1000,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"pre_calculate_formulas" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"strict_null_comparison" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"csv" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"delimiter" => ",",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"enclosure" => '"',
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"line_ending" => PHP_EOL,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"use_bom" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"include_separator_line" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"excel_compatibility" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"output_encoding" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"properties" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"creator" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"lastModifiedBy" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"title" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"description" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"subject" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"keywords" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"category" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"manager" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"company" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"imports" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"read_only" => true,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"ignore_empty" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"heading_row" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"formatter" => "slug",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"csv" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"delimiter" => ",",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"enclosure" => '"',
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"escape_character" => "\\",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"contiguous" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"input_encoding" => "UTF-8",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"properties" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"creator" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"lastModifiedBy" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"title" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"description" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"subject" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"keywords" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"category" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"manager" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"company" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"extension_detector" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xlsx" => Excel::XLSX,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xlsm" => Excel::XLSX,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xltx" => Excel::XLSX,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xltm" => Excel::XLSX,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xls" => Excel::XLS,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xlt" => Excel::XLS,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"ods" => Excel::ODS,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"ots" => Excel::ODS,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"slk" => Excel::SLK,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xml" => Excel::XML,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"gnumeric" => Excel::GNUMERIC,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"htm" => Excel::HTML,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"html" => Excel::HTML,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"csv" => Excel::CSV,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"tsv" => Excel::TSV,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"pdf" => Excel::DOMPDF,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"value_binder" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"default" => Maatwebsite\Excel\DefaultValueBinder::class,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"cache" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"driver" => "memory",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"batch" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"memory_limit" => 60000,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"illuminate" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"store" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"transactions" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"handler" => "db",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"db" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"connection" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"temporary_files" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"local_path" => storage_path("framework/cache/laravel-excel"),
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"remote_disk" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"remote_prefix" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"force_resync_remote" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
];
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.

View File

@@ -1,10 +1,20 @@
<template>
<InertiaHead title="Kalendarz urlopów" />
<div class="bg-white shadow-md">
<div class="p-4 sm:px-6">
<h2 class="text-lg leading-6 font-medium text-gray-900">
Kalendarz urlopów
</h2>
<div class="flex justify-between items-center p-4 sm:px-6">
<div>
<h2 class="text-lg leading-6 font-medium text-gray-900">
Kalendarz urlopów
</h2>
</div>
<div>
<a
:href="`timesheet?month=${currentMonth}`"
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
>
Pobierz plik excel
</a>
</div>
</div>
<div class="overflow-x-auto">
<table class="w-full text-center table-fixed text-sm border border-gray-300">

View File

@@ -43,6 +43,11 @@
"Vacation request has been created.": "Wniosek urlopowy został utworzony.",
"Vacation request has been accepted.": "Wniosek urlopowy został zaakceptowany.",
"Vacation request has been rejected.": "Wniosek urlopowy został odrzucony.",
"Vacation request has been canceled.": "Wniosek urlopowy został anulowany."
"Vacation request has been canceled.": "Wniosek urlopowy został anulowany.",
"Sum:": "Suma:",
"Date": "Data",
"Day of week": "Dzień tygodnia",
"Start date": "Data rozpoczecia",
"End date": "Data zakończenia",
"Worked hours": "Ilość godzin"
}

View File

@@ -7,6 +7,7 @@ use Toby\Infrastructure\Http\Controllers\GoogleController;
use Toby\Infrastructure\Http\Controllers\HolidayController;
use Toby\Infrastructure\Http\Controllers\LogoutController;
use Toby\Infrastructure\Http\Controllers\SelectYearPeriodController;
use Toby\Infrastructure\Http\Controllers\TimesheetController;
use Toby\Infrastructure\Http\Controllers\UserController;
use Toby\Infrastructure\Http\Controllers\VacationCalendarController;
use Toby\Infrastructure\Http\Controllers\VacationLimitController;
@@ -26,6 +27,8 @@ Route::middleware("auth")->group(function (): void {
->name("vacation.limits");
Route::get("/vacation-calendar", [VacationCalendarController::class, "index"])
->name("vacation.calendar");
Route::get("/timesheet", TimesheetController::class)
->name("timesheet");
Route::get("/vacation-limits", [VacationLimitController::class, "edit"])->name("vacation.limits");
Route::put("/vacation-limits", [VacationLimitController::class, "update"]);