@php use App\Models\Currency; $sym = Currency::symbolFor($currency); $m = fn ($minor) => $sym . number_format(((int) $minor) / 100, 0); $md = fn ($minor) => $sym . number_format(((int) $minor) / 100, 2); $agB = $aging['buckets'] ?? []; @endphp
{{ __('Overview') }}

{{ __('Your') }} {{ __('CRM') }}

{{ __('Deals, invoices, payments and tasks — the whole business in one view.') }}

{{ __('Revenue report') }}
@php // Built here, not inline in the :steps attribute. The last step // contains a link, and a double-quoted HTML attribute cannot hold // an anchor whose href is also double quoted — the browser ends the // attribute at the first inner quote and prints the rest of the PHP // array as visible page text, which is what leaked under the // heading here. Passing a variable keeps the markup out of the // attribute entirely, and :link is a translator placeholder so the // sentence stays translatable with the anchor intact. $crmSteps = [ __('This is your home screen — pipeline, revenue, outstanding money and tasks at a glance.'), __('Click any number to jump to that page (deals, invoices, payments).'), __('Open Revenue report for collected / outstanding / tax, then export to CSV or PDF.'), __('New here? Open the :link for every page and how to use it.', [ 'link' => '' . __('CRM guide') . '', ]), ]; @endphp {{-- KPI row --}}
@foreach ([ ['Open pipeline', $m($kpis['open_value_minor']), $kpis['open_deals'] . ' ' . __('deals'), url('/deals'), 'text-ink-900'], ['Won this month', $m($kpis['won_month_minor']), __('closed'), url('/deals'), 'text-wa-deep'], ['Collected (mo.)', $m($kpis['collected_month_minor']), __('this month'), url('/payments'), 'text-wa-deep'], ['Outstanding', $m($kpis['outstanding_minor']), $kpis['invoices_open'] . ' ' . __('invoices'), url('/payments'), 'text-accent-coral'], ] as [$label, $val, $sub, $href, $col])
{{ __($label) }}
{{ $val }}
{{ $sub }}
@endforeach
@foreach ([ ['Paid invoices', $kpis['invoices_paid'], url('/invoices')], ['Open tasks', $kpis['tasks_open'], url('/tasks')], ['Overdue tasks', $kpis['tasks_overdue'], url('/tasks')], ['Contacts', $kpis['contacts'], url('/contacts')], ] as [$label, $val, $href])
{{ __($label) }}
{{ $val }}
@endforeach
{{-- Aging --}}
{{ __('Receivables aging') }}
@foreach (['0-30','31-60','61-90','90+'] as $b)
{{ $b }} {{ __('days') }} {{ $md($agB[$b] ?? 0) }}
@endforeach
{{-- Recent payments --}}
{{ __('Recent payments') }}
@forelse ($recentPayments as $p)
{{ $p->contact?->name ?: optional($p->paid_at)->format('d M') }} {{ $p->amount_display }}
@empty
{{ __('No payments yet.') }}
@endforelse
{{-- Upcoming tasks --}}
{{ __('Upcoming tasks') }}
{{ __('All') }}
@forelse ($upcomingTasks as $t)
{{ $t->title }} {{ optional($t->due_at)->format('d M') }}
@empty
{{ __('Nothing scheduled.') }}
@endforelse