@php $money = fn ($value) => 'R '.number_format((float) $value, 2); $formatMetric = fn (array $metric) => $metric['currency'] ? $money($metric['current']) : number_format((float) $metric['current']); $trendClass = fn (array $metric) => match ($metric['direction']) { 'up' => 'dashboard-trend-up', 'down' => 'dashboard-trend-down', default => 'dashboard-trend-flat', }; @endphp @can('create-invoices') New invoice @endcan @can('create-quotations') New quotation @endcan @can('record-payments') Record payment @endcan

Outstanding Balance

{{ $money($stats['outstanding_revenue']) }}

Collectible unpaid balances.

Overdue Balance

{{ $money($stats['overdue_revenue'] ?? $overdue['amount']) }}

{{ $stats['overdue_invoices'] }} overdue {{ Str::plural('invoice', $stats['overdue_invoices']) }}.

Paid Revenue (This Month)

{{ $money($stats['paid_revenue']) }}

Successful payments received this month.

Total Credited

{{ $money($stats['total_credited'] ?? 0) }}

Issued credits and refunds.

Operations

Needs attention today

Priority work with a clear next step.

@if ($actionQueue['total'] > 0) {{ $actionQueue['total'] }} open @else All clear @endif
@if (empty($actionQueue['items']))

No open actions

Nothing requires attention right now.

@else @endif

Revenue trend

Monthly Paid Revenue

{{ $monthlyRevenue['range_label'] ?? 'Last 12 months' }}.

@if ($monthlyRevenue['total'] <= 0)

No revenue data yet

Record a payment to show revenue.

@else @php $chartPoints = collect($monthlyRevenue['points'])->values(); $chartMax = max(1, (float) ($monthlyRevenue['max'] ?? $chartPoints->max('total') ?? 0)); $chartCount = max(1, $chartPoints->count()); $plotTop = 8; $plotHeight = 72; $linePoints = $chartPoints->map(function ($point, $index) use ($chartMax, $chartCount, $plotTop, $plotHeight) { $x = $chartCount <= 1 ? 50 : 4 + (($index / ($chartCount - 1)) * 92); $y = $plotTop + (1 - ((float) $point['total'] / $chartMax)) * $plotHeight; return array_merge($point, [ 'x' => round($x, 2), 'y' => round($y, 2), ]); }); $polylinePoints = $linePoints->map(fn ($point) => $point['x'].','.$point['y'])->implode(' '); $areaPath = 'M 0 88 L '.$linePoints->map(fn ($point) => $point['x'].' '.$point['y'])->implode(' L ').' L 100 88 Z'; $yAxisTicks = collect([1, 0.75, 0.5, 0.25, 0])->map(fn ($ratio) => [ 'label' => $money($chartMax * $ratio), 'top' => $plotTop + (1 - $ratio) * $plotHeight, ]); @endphp
@foreach ($linePoints as $point)
{{ $point['full_label'] }} · {{ $money($point['total']) }}
@endforeach
@foreach ($linePoints as $point) {{ $point['label'] }} @endforeach
@endif

Activity

Recent payments

Latest received payments.

@if ($recentPayments->isEmpty())

No recent payments

Record a payment to show activity.

@else @endif

Clients

Top clients by revenue

Ranked by received payments.

@if ($topClients->isEmpty())

No client revenue yet

Add payments to rank clients.

@else @endif

Momentum

This month vs last month

Compare this month with last month.

@foreach ($comparison as $metric)

{{ $metric['label'] }}

{{ $formatMetric($metric) }}

@if ($metric['change'] === null)

No previous data

@else

{{ $metric['change'] > 0 ? '+' : '' }}{{ $metric['change'] }}% vs last month

@endif
@endforeach