@extends('layouts.dashboard.superadminapp') @section('title', 'Accounts Receivable - Aging Report') @section('styles') @endsection @section('content')

Accounts Receivable - Aging Report

Total Outstanding Receivables
₹{{ number_format($grandTotal, 2) }}
Current (0-30 days)
₹{{ number_format($aging['current']['total'], 2) }}
{{ $aging['current']['items']->count() }} invoices
31-60 Days
₹{{ number_format($aging['days_30']['total'], 2) }}
{{ $aging['days_30']['items']->count() }} invoices
61-90 Days
₹{{ number_format($aging['days_60']['total'], 2) }}
{{ $aging['days_60']['items']->count() }} invoices
90+ Days
₹{{ number_format($aging['days_90_plus']['total'], 2) }}
{{ $aging['days_90_plus']['items']->count() }} invoices
@foreach(['current' => 'Current (0-30 days)', 'days_30' => '31-60 Days', 'days_60' => '61-90 Days', 'days_90_plus' => '90+ Days'] as $key => $label) @if($aging[$key]['items']->count() > 0)
{{ $label }} - ₹{{ number_format($aging[$key]['total'], 2) }}
@foreach($aging[$key]['items'] as $invoice) @php $daysOld = \Carbon\Carbon::parse($invoice->invoice_date)->diffInDays(now()); @endphp @endforeach
Invoice No Date Customer Days Old Total Paid Balance Action
{{ $invoice->invoice_no }} {{ \Carbon\Carbon::parse($invoice->invoice_date)->format('d M Y') }} {{ $invoice->company->company_name ?? 'N/A' }} {{ $daysOld }} days ₹{{ number_format($invoice->total_amount, 2) }} ₹{{ number_format($invoice->paid_amount ?? 0, 2) }} ₹{{ number_format($invoice->balance_amount ?? $invoice->total_amount, 2) }} Collect
@endif @endforeach @endsection