@php use App\Models\Currency; $sym = Currency::symbolFor($currency); $md = fn ($minor) => $sym . number_format(((int) $minor) / 100, 2); $agB = $aging['buckets'] ?? []; $maxMonth = max(1, collect($collectedByMonth)->max('minor')); @endphp
{{ __('CRM') }} · {{ __('Reports') }}

{{ __('Revenue') }} {{ __('report') }}

{{ __('Generated') }} {{ $generatedAt }}.

@if ($mixedCurrency)
{{ __('Payments span more than one currency — totals below are summed in raw amounts and shown in the workspace currency. Filter to a single currency for exact figures.') }}
@endif
@foreach ([ ['Collected (30d)', $md($collected30), 'text-wa-deep'], ['Collected (all)', $md($collectedAll), 'text-ink-900'], ['Outstanding', $md($outstanding), 'text-accent-coral'], ['Tax collected', $md($taxCollected), 'text-ink-900'], ] as [$label, $val, $col])
{{ __($label) }}
{{ $val }}
@endforeach
{{-- Collected by month --}}
{{ __('Collected — last 6 months') }}
@foreach ($collectedByMonth as $mo)
{{ $md($mo['minor']) }}
{{ $mo['label'] }}
@endforeach
{{-- Aging --}}
{{ __('Receivables aging') }} ({{ $aging['count'] ?? 0 }} {{ __('invoices') }})
@foreach (['0-30','31-60','61-90','90+'] as $b)
{{ $b }}
{{ $md($agB[$b] ?? 0) }}
@endforeach