authorize('reports.view'); if (! $this->dayIsValid()) { $this->day = $clock->today()->format('Y-m-d'); } } #[Computed] public function report(): ?UnbilledReport { if (! $this->dayIsValid()) { return null; } return app(UnbilledHoursReport::class)->execute($this->day, ctype_digit($this->serviceUnit) ? (int) $this->serviceUnit : null); } public function updated(): void { $this->authorize('reports.view'); unset($this->report); } public function dayIsValid(): bool { try { new ReportPeriod($this->day, $this->day); return true; } catch (InvalidReportPeriod) { return false; } } public function csv(): string { return route('reports.csv', array_filter(['report' => 'unbilled', 'paiva' => $this->day, 'yksikko' => $this->serviceUnit])); } public function valueText(UnbilledJob $row): string { if ($row->valueCents === null) { return __('reports.unbilled.in_price'); } return $this->money($row->valueCents).($row->missingRate ? ' '.__('reports.unbilled.missing_rate_short') : ''); } public function render(): mixed { return $this->view()->title(__('reports.unbilled.title')); } }; ?>
{{ __('reports.unbilled.intro') }}
{{ __('reports.unbilled.invalid_day') }}
@else| {{ __('reports.unbilled.job') }} | {{ __('reports.unbilled.status') }} | {{ __('reports.unbilled.oldest') }} | {{ __('reports.unbilled.approved') }} | {{ __('reports.unbilled.unapproved') }} | {{ __('reports.unbilled.value') }} |
|---|---|---|---|---|---|
{{ __('reports.unbilled.by_work_type', ['job' => $row->job->number]) }}
|
|
{{ $this->dateLabel($row->oldestDay) }} | {{ $this->hours($row->approvedQuarters) }} | {{ $this->hours($row->unapprovedQuarters) }} | {{ $this->valueText($row) }} |
| {{ __('reports.total') }} | {{ $this->hours($report->approvedQuarters) }} | {{ $this->hours($report->unapprovedQuarters) }} | {{ $this->money($report->valueCents) }} | ||