startPeriod($clock, 'this_year'); } #[Computed] public function report(): ?ProfitabilityReport { $period = $this->period(); return $period === null ? null : app(ProfitabilityByJob::class)->execute($period, $this->includeInternal); } public function updated(): void { $this->authorize('reports.view'); unset($this->report); } public function margin(Profit $profit): string { $margin = $profit->marginCents(); return $margin === null ? '–' : $this->money($margin); } public function marginPercent(Profit $profit): string { $ratio = $profit->marginRatio(); return $ratio === null ? '–' : $this->percent($ratio); } public function hourCost(Profit $profit): string { return $profit->hourCostCents === null ? '–' : $this->money($profit->hourCostCents); } public function effectiveRate(Profit $profit): string { $cents = $profit->effectiveHourlyCents(); return $cents === null ? '–' : $this->money($cents); } public function render(): mixed { return $this->view()->title(__('reports.profitability.title')); } }; ?>
{{ __('reports.profitability.intro') }}
{{ __('reports.profitability.no_cost') }}
@can('catalog.manage')
{{ __('reports.profitability.cost_used', ['cost' => $this->money($report->hourlyCostCents)]) }}
@endif @if ($report->jobs === []){{ __('reports.profitability.none') }}
@else{{ __('reports.profitability.split_note') }}
| {{ __('reports.profitability.service_unit') }} | {{ __('reports.profitability.jobs') }} | {{ __('reports.profitability.hours') }} | {{ __('reports.profitability.revenue') }} | {{ __('reports.profitability.costs') }} | {{ __('reports.profitability.margin') }} | {{ __('reports.profitability.margin_percent') }} |
|---|---|---|---|---|---|---|
| {{ $unit->name !== '' ? $unit->name : __('reports.profitability.no_service_unit') }} | {{ $unit->jobCount }} | {{ $this->hours($unit->profit->quarters) }} | {{ $this->money($unit->profit->revenueCents()) }} | {{ $this->money($unit->profit->expenseCostCents + ($unit->profit->hourCostCents ?? 0)) }} | {{ $this->margin($unit->profit) }} | {{ $this->marginPercent($unit->profit) }} |
| {{ __('reports.profitability.job') }} | {{ __('reports.profitability.hours') }} | {{ __('reports.profitability.billed_hours') }} | {{ __('reports.profitability.work_revenue') }} | {{ __('reports.profitability.expense_revenue') }} | {{ __('reports.profitability.expense_cost') }} | {{ __('reports.profitability.hour_cost') }} | {{ __('reports.profitability.margin') }} | {{ __('reports.profitability.margin_percent') }} | {{ __('reports.profitability.effective_rate') }} |
|---|---|---|---|---|---|---|---|---|---|
|
|
{{ $this->hours($row->profit->quarters) }} | {{ $this->hours($row->profit->billedQuarters) }} | {{ $this->money($row->profit->workCents) }} | {{ $this->money($row->profit->expenseRevenueCents) }} | {{ $this->money($row->profit->expenseCostCents) }} | {{ $this->hourCost($row->profit) }} | {{ $this->margin($row->profit) }} | {{ $this->marginPercent($row->profit) }} | {{ $this->effectiveRate($row->profit) }} |
| {{ __('reports.total') }} | {{ $this->hours($report->total->quarters) }} | {{ $this->hours($report->total->billedQuarters) }} | {{ $this->money($report->total->workCents) }} | {{ $this->money($report->total->expenseRevenueCents) }} | {{ $this->money($report->total->expenseCostCents) }} | {{ $this->hourCost($report->total) }} | {{ $this->margin($report->total) }} | {{ $this->marginPercent($report->total) }} | {{ $this->effectiveRate($report->total) }} |