@extends('layouts.print') @section('title', 'AR Aging — ' . $today->format('M j, Y')) @section('content') @php $propName = \App\Models\Setting::get('property_name', config('app.name', 'Parkview Hotel')); $bucketMeta = [ 'in_house' => 'In-House', 'current' => 'Current', 'd1_30' => '1–30 days', 'd31_60' => '31–60 days', 'd60_plus' => '60+ days', ]; @endphp
@include('reports.print._letterhead', [ 'reportTitle' => 'AR Aging', 'periodLabel' => 'As of ' . $today->format('M j, Y'), 'backUrl' => route('reports.ar-aging'), ])
{{-- Aging buckets --}}
@foreach($bucketMeta as $key => $label)

{{ $label }}

₱{{ number_format($buckets[$key], 0) }}

@endforeach
In-house exposure: ₱{{ number_format($inHouseExposure, 2) }} · Departed owing: ₱{{ number_format($departedOwing, 2) }} Total Outstanding: ₱{{ number_format($totalOutstanding, 2) }}
{{-- Table --}}

Outstanding Balances ({{ $accounts }})

@if(empty($rows))

No outstanding balances.

@else @foreach($rows as $row) @endforeach
Guest Booking # Room Check-out Aging Charges Paid Balance
{{ $row['guest_name'] }} {{ $row['booking_no'] }} {{ $row['room_no'] }} {{ $row['check_out']->format('M j, Y') }} {{ $bucketMeta[$row['bucket']] }}{{ $row['days_past'] ? ' · ' . $row['days_past'] . 'd' : '' }} ₱{{ number_format($row['charges'], 2) }} ₱{{ number_format($row['paid'], 2) }} ₱{{ number_format($row['balance'], 2) }}
Total Outstanding ₱{{ number_format($totalOutstanding, 2) }}
@endif
@if(!empty($credits))

Credit Balances — possible refunds due

@foreach($credits as $c) @endforeach
{{ $c['guest_name'] }} {{ $c['booking_no'] }} Room {{ $c['room_no'] }} +₱{{ number_format($c['credit'], 2) }}
@endif
{{ $propName }} · AR Aging Printed {{ now()->format('M j, Y g:i A') }}
@endsection