@extends('layouts.inspinia') @section('title', 'Supplier Aging Report') @section('content_header', 'Supplier Aging Report') @section('breadcrumb') @endsection @section('content')
Operational aging report — not full accounting GL. Supplier invoices are tracked in base currency (TZS). This report shows how long payables have been outstanding.
@php $bucketColors = [ 'current' => 'success', '1_30' => 'info', '31_60' => 'warning', '61_90' => 'orange', '90_plus' => 'danger', ]; @endphp {{-- Filters --}}
Filters
{{-- Totals Summary Bar --}}
@foreach(['current' => 'Current', '1_30' => '1–30 Days', '31_60' => '31–60 Days', '61_90' => '61–90 Days', '90_plus' => '90+ Days'] as $key => $label)
{{ $label }} TZS {{ number_format($totals[$key], 0) }}
@endforeach
Total Payable TZS {{ number_format($totals['total_balance'], 0) }}
{{-- Supplier Summary Table --}}
Supplier Summary — As of {{ $asOfDate->format('d M Y') }} (all amounts in TZS)
{{ $supplierRows->count() }} supplier(s)
@forelse($supplierRows as $i => $row) @empty @endforelse @if($supplierRows->count() > 0) @endif
# Supplier Current 1–30 Days 31–60 Days 61–90 Days 90+ Days Total Payable (TZS)
{{ $i + 1 }} {{ $row['supplier']?->name ?? '—' }} @if($row['current'] > 0) {{ number_format($row['current'], 0) }} @else@endif @if($row['1_30'] > 0) {{ number_format($row['1_30'], 0) }} @else@endif @if($row['31_60'] > 0) {{ number_format($row['31_60'], 0) }} @else@endif @if($row['61_90'] > 0) {{ number_format($row['61_90'], 0) }} @else@endif @if($row['90_plus'] > 0) {{ number_format($row['90_plus'], 0) }} @else@endif {{ number_format($row['total_balance'], 0) }}
No outstanding supplier invoices found.
TOTAL (TZS) {{ number_format($totals['current'], 0) }} {{ number_format($totals['1_30'], 0) }} {{ number_format($totals['31_60'], 0) }} {{ number_format($totals['61_90'], 0) }} {{ number_format($totals['90_plus'], 0) }} {{ number_format($totals['total_balance'], 0) }}
{{-- Invoice Detail Table --}}
Invoice Detail
{{ $invoices->count() }} invoice(s)
@forelse($invoices as $i => $inv) @php $bucketLabel = match($inv->bucket) { 'current' => 'Current', '1_30' => '1–30 Days', '31_60' => '31–60 Days', '61_90' => '61–90 Days', '90_plus' => '90+ Days', default => $inv->bucket, }; $badgeColor = $bucketColors[$inv->bucket] ?? 'secondary'; @endphp @empty @endforelse
# Invoice # Supplier Invoice Date Due / Aging Date Total Amount Amount Paid Balance Due Days Overdue Bucket
{{ $i + 1 }} {{ $inv->supplier_invoice_number }} {{ $inv->supplier?->name ?? '—' }} {{ $inv->invoice_date?->format('d-m-Y') ?? '—' }} {{ $inv->aging_date?->format('d-m-Y') ?? '—' }} @if(!$inv->due_date) (inv.date) @endif {{ number_format($inv->total_amount, 2) }} {{ number_format($inv->amount_paid, 2) }} {{ number_format($inv->balance_due, 2) }} @if($inv->days_overdue > 0) {{ $inv->days_overdue }} @elseif($inv->days_overdue == 0) 0 @else {{ abs($inv->days_overdue) }} left @endif {{ $bucketLabel }}
No invoices found.
@endsection