@extends('layouts.master') @section('page_title', 'Accounts Receivable Report') @section('content')
Accounts Receivable Filters

Accounts Receivable Report

As of: {{ Carbon\Carbon::parse($asOfDate)->format('M d, Y') }}

Generated: {{ Carbon\Carbon::now()->format('M d, Y g:i A') }}

Outstanding Bills: {{ $receivables->count() }}

${{ number_format($receivables->sum('outstanding_amount'), 2) }}

Total Outstanding

{{ $agingSummary['Current']['count'] ?? 0 }}

Current (0-30 days)

{{ ($agingSummary['31-60 Days']['count'] ?? 0) + ($agingSummary['61-90 Days']['count'] ?? 0) }}

31-90 Days

{{ $agingSummary['Over 90 Days']['count'] ?? 0 }}

Over 90 Days

Aging Summary
@php $totalOutstanding = $receivables->sum('outstanding_amount'); @endphp @foreach(['Current', '31-60 Days', '61-90 Days', 'Over 90 Days'] as $category) @php $count = $agingSummary[$category]['count'] ?? 0; $amount = $agingSummary[$category]['total'] ?? 0; $percentage = $totalOutstanding > 0 ? ($amount / $totalOutstanding) * 100 : 0; @endphp @endforeach
Aging Category Number of Bills Outstanding Amount Percentage
{{ $category }} {{ $count }} ${{ number_format($amount, 2) }} {{ number_format($percentage, 1) }}%
Total {{ $receivables->count() }} ${{ number_format($totalOutstanding, 2) }} 100.0%
Outstanding Receivables Detail
@if($receivables->count() > 0)
@foreach($receivables->sortBy('aging_category') as $receivable) @endforeach
Student ID Student Name Class Term Bill Amount Payments Discounts Outstanding Days Aging Bill Date
{{ $receivable->student_username }} {{ $receivable->student_name }} {{ $receivable->class_name }} {{ $receivable->term_name ?? 'N/A' }} ${{ number_format($receivable->total_amount, 2) }} ${{ number_format($receivable->payments_received, 2) }} ${{ number_format($receivable->discounts_applied, 2) }} ${{ number_format($receivable->outstanding_amount, 2) }} {{ $receivable->days_outstanding }} {{ $receivable->aging_category }} {{ Carbon\Carbon::parse($receivable->bill_date)->format('M d, Y') }}
Grand Total ${{ number_format($receivables->sum('outstanding_amount'), 2) }}
@else
Excellent News!
No outstanding receivables found. All bills have been paid in full!
@endif
@endsection