authorize('billing.manage'); $this->jobId = $job; if (app(MonthlyBillingViews::class)->forJob($job) === null) { abort(404); } } #[Computed] public function billing(): MonthlyBillingView { return app(MonthlyBillingViews::class)->forJob($this->jobId) ?? abort(404); } public function monthLabel(string $month): string { return BillingMonths::label($month); } public function dayLabel(string $date): string { return (new DateTimeImmutable($date))->format('j.n.Y'); } public function heading(): string { return __('billing.job_months.title', ['job' => $this->billing->job->number.' '.$this->billing->job->name]); } /** * @return list */ public function headers(): array { return [ ['index' => 'month', 'label' => __('billing.job_months.columns.month'), 'sortable' => false], ['index' => 'export', 'label' => __('billing.job_months.columns.export'), 'sortable' => false], ['index' => 'finalized', 'label' => __('billing.job_months.columns.finalized'), 'sortable' => false], ['index' => 'net', 'label' => __('billing.job_months.columns.net'), 'sortable' => false, 'align' => 'right'], ]; } public function render(): mixed { return $this->view()->title($this->heading()); } }; ?> @php($billing = $this->billing) @php($job = $billing->job)

{{ __('billing.job_months.back') }}

{{ $this->heading() }}

{{ __('billing.job_months.intro') }}

{{ __('billing.job_months.summary') }}

{{ __('billing.job_months.customer') }}
{{ $job->customerName }}
{{ __('billing.job_months.monthly_fee') }}
{{ $job->monthlyFeeCents === null ? __('billing.job_months.no_fee') : $this->money($job->monthlyFeeCents).' '.__('billing.job_months.vat_excluded') }}
{{ __('billing.job_months.starts') }}
{{ $job->billingStartsOn === '' ? '–' : $this->monthLabel(substr($job->billingStartsOn, 0, 7)) }}
{{ __('billing.job_months.ends') }}
{{ $billing->billingEndsOn === null ? __('billing.job_months.no_end') : $this->dayLabel($billing->billingEndsOn) }}
{{ __('billing.job_months.billing_unit') }}
{{ $job->billingUnitName ?? __('billing.invoices.no_billing_unit') }}
@if (! $job->inBillableStatus)

@endif

{{ __('billing.job_months.billed_title', ['count' => count($billing->billed)]) }}

@if ($billing->billed === [])

{{ __('billing.job_months.none_billed') }}

@else @interact('column_month', $month) {{ $this->monthLabel($month->month) }} @endinteract @interact('column_export', $month) {{ __('billing.index.export_label', ['number' => $month->exportNumber]) }} @endinteract @interact('column_finalized', $month) {{ $month->finalizedAt === null ? '' : $this->timeLabel($month->finalizedAt) }} @endinteract @interact('column_net', $month) {{ $this->money($month->netCents) }} @endinteract

{{ __('billing.job_months.billed_total', ['net' => $this->money($billing->billedNetCents())]) }}

@endif

{{ __('billing.job_months.unbilled_title', ['month' => $this->monthLabel($billing->currentMonth)]) }}

@if ($billing->unbilled === [])

@else
    @foreach ($billing->unbilled as $month)
  • {{ $this->monthLabel($month) }}
  • @endforeach

{{ __('billing.job_months.unbilled_help') }}

@endif