{{-- resources/views/reports/invoice-aging.blade.php --}} @extends('layouts.app') @section('title', 'Invoice Aging') @section('page_title', 'Invoice Aging Report') @section('page_subtitle', 'Outstanding invoices by age') @section('content') @include('reports.partials.nav') {{-- Total --}}
${{ number_format($total, 0) }}
Total Outstanding
@foreach(['0_30' => 'si-warning', '61_90' => 'si-danger', 'over_90' => 'si-danger'] as $key => $icon)
${{ number_format($buckets[$key]['total'], 0) }}
{{ $buckets[$key]['label'] }}
@endforeach
{{-- Buckets --}} @foreach($buckets as $key => $bucket) @if($bucket['invoices']->count() > 0)
{{ $bucket['label'] }} {{ $bucket['invoices']->count() }} {{ Str::plural('invoice', $bucket['invoices']->count()) }} ${{ number_format($bucket['total'], 2) }}
@foreach($bucket['invoices'] as $inv) @endforeach
Invoice # Guest / Company Invoice Date Due Date Total Balance
{{ $inv->invoice_number }} @if($inv->guest) {{ $inv->guest->first_name }} {{ $inv->guest->last_name }} @elseif($inv->company) {{ $inv->company->name }} @else — @endif {{ $inv->invoice_date->format('d M Y') }} {{ $inv->due_date->format('d M Y') }} @if($key !== 'current')
{{ $inv->due_date->diffForHumans() }} @endif
{{ $inv->currency }} {{ number_format($inv->total_amount, 2) }} {{ $inv->currency }} {{ number_format($inv->balance_due, 2) }} View →
@endif @endforeach @if($total === 0.0 || $total === 0)

All invoices are settled!

No outstanding balances.

@endif @endsection