@php $bucketColor = fn (string $bucket): string => match ($bucket) { '0–30 days' => 'emerald', '31–60 days' => 'amber', '61–90 days' => 'orange', 'Over 90 days' => 'rose', default => 'gray', }; $bucketText = fn (string $bucket): string => match ($bucket) { '0–30 days' => 'text-emerald-600', '31–60 days' => 'text-amber-600', '61–90 days' => 'text-orange-600', 'Over 90 days' => 'text-rose-600', default => 'text-slate-900', }; @endphp
@foreach ($buckets as $bucket => $amountDue)
{{ $bucket }}
{{ money($amountDue, false) }}
@endforeach
Total outstanding
{{ money($total, false) }}
@if (request()->hasAny(['q', 'as_of'])) Clear @endif
@if ($rows->isEmpty()) @if ($tab === 'patient') @else @endif @else
@foreach ($rows as $row) @endforeach
{{ $tab === 'patient' ? 'Patient' : 'Payer' }} Reference Date Due Age Amount Bucket
{{ $row['party'] }}
@if ($row['detail'])
{{ $row['detail'] }}
@endif
{{ $row['reference'] }} {{ $row['date']?->format('d M Y') ?? '—' }} {{ $row['due']?->format('d M Y') ?? '—' }} {{ number_format($row['age']) }} d {{ money($row['amount'], false) }}
Total outstanding {{ money($total, false) }}
@endif