@extends('layouts.app') @section('title', 'Collections') @section('content')

Collections & aging

Receivables and recovery performance.

Overdue invoices
@include('components.kpi', ['label' => 'Total receivable', 'value' => money($summary['total_receivable']), 'variant' => 'warn', 'href' => '#']) @include('components.kpi', ['label' => 'Overdue', 'value' => money($summary['overdue_amount']), 'variant' => 'bad', 'href' => '#']) @include('components.kpi', ['label' => 'Collection rate', 'value' => percent($summary['collection_rate']), 'variant' => $summary['collection_rate'] >= 90 ? 'good' : 'warn', 'href' => '#']) @include('components.kpi', ['label' => 'Accounts at risk', 'value' => number_format($summary['at_risk_accounts']), 'variant' => $summary['at_risk_accounts'] > 0 ? 'bad' : 'good', 'href' => '#'])

Aging buckets

@php $maxBucket = collect($aging)->max('amount') ?: 1; @endphp @foreach ($aging as $bucket)
{{ $bucket['label'] }} {{ money($bucket['amount']) }}
@endforeach

Collections trend — 6 months

@include('components.chart', [ 'series' => collect($trend)->map(fn ($t) => [ 'label' => \Carbon\Carbon::parse($t['month'])->format('M y'), 'value' => $t['collected'], ])->all(), 'type' => 'line', 'format' => 'money', 'height' => 200, ])

Top debtors

@forelse ($debtors as $debtor) @empty @endforelse
CustomerOutstandingOverdue Oldest invoiceStatus
{{ $debtor->customer->display_name }}
{{ $debtor->customer->customer_number }}
{{ money($debtor->outstanding, $debtor->customer->currency) }} {{ money($debtor->overdue, $debtor->customer->currency) }} {{ $debtor->oldest_days }} days {{ $debtor->customer->status }} Collect
@include('components.empty-state', ['icon' => '✓', 'title' => 'No outstanding balances'])
@endsection