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.title') }}

{{ __('reports.unbilled.intro') }}

@php($report = $this->report)
@if ($report !== null) {{-- TallStackUI's native select does not tie its label to the control, so aria-label names it. --}} @foreach ($report->serviceUnits as $id => $name) @endforeach @endif
@if ($report === null) @else

{{ __('reports.unbilled.until', ['day' => $this->dateLabel($day)]) }}

@if ($report->jobs === [])

{{ __('reports.unbilled.none') }}

@else
@foreach ($report->jobs as $row) @endforeach
{{ __('reports.unbilled.table', ['day' => $this->dateLabel($day)]) }}
{{ __('reports.unbilled.job') }} {{ __('reports.unbilled.status') }} {{ __('reports.unbilled.oldest') }} {{ __('reports.unbilled.approved') }} {{ __('reports.unbilled.unapproved') }} {{ __('reports.unbilled.value') }}
{{ $row->job->number }} {{ $row->job->name }} {{ $row->job->customerName }}
{{ __('reports.unbilled.by_work_type', ['job' => $row->job->number]) }}
    @foreach ($row->workTypes as $line)
  • {{ __('reports.unbilled.work_type_line', [ 'name' => $line->name, 'approved' => $this->hours($line->approvedQuarters), 'unapproved' => $this->hours($line->unapprovedQuarters), ]) }}@if ($line->valueCents !== null), {{ $this->money($line->valueCents) }}@elseif ($row->job->billsHours) ({{ __('reports.unbilled.missing_rate') }})@endif
  • @endforeach
{{ __('jobs.statuses.'.$row->job->status) }} @if ($row->job->paymentBasis !== null) {{ __('jobs.payment_bases.'.$row->job->paymentBasis) }} @endif {{ $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) }}
@endif @endif