@extends('layouts.app') @section('title', 'Billing & Folios') @section('nav_folio', 'bg-teal-50 text-teal-700 font-semibold') @section('page_title', 'Billing & Folios') @section('page_subtitle', 'Folio overview for active and recently checked-out reservations') @section('content') @if (session('success'))

{{ session('success') }}

@endif @php $statusBadge = [ 'confirmed' => 'bg-teal-50 text-teal-700 border-[0.5px] border-teal-200', 'checked_in' => 'bg-green-50 text-green-700 border-[0.5px] border-green-200', 'checked_out' => 'bg-gray-50 text-gray-500 border-[0.5px] border-gray-200', ]; $statusLabel = [ 'confirmed' => 'Confirmed', 'checked_in' => 'In-House', 'checked_out' => 'Checked Out', ]; @endphp {{-- Stats --}}

Outstanding Balance

₱{{ number_format($stats['outstanding_amount'], 0) }}

{{ $stats['outstanding_count'] }} account{{ $stats['outstanding_count'] !== 1 ? 's' : '' }} with balance due @if($hasFilters) · filtered @endif

Settled Accounts

{{ $stats['settled_count'] }}

Fully paid — no balance @if($hasFilters) · filtered @endif

Showing

{{ $reservations->count() }}

{{ $hasFilters ? 'matching records' : 'confirmed, in-house & checked-out' }}

{{-- Search & Filter bar --}}
{{-- Search --}}
{{-- Status --}} {{-- Balance --}} {{-- Check-out from --}}
to
{{-- Apply --}} {{-- Clear --}} @if($hasFilters) Clear @endif
{{-- Active filter pills --}} @if($hasFilters)
Active filters: @if($search !== '') Search: "{{ $search }}" @endif @if($status !== '') Status: {{ $statusLabel[$status] ?? $status }} @endif @if($balance !== '') Balance: {{ $balance === 'due' ? 'Balance Due' : 'Settled' }} @endif @if($from !== '') From: {{ \Carbon\Carbon::parse($from)->format('M j, Y') }} @endif @if($to !== '') To: {{ \Carbon\Carbon::parse($to)->format('M j, Y') }} @endif
@endif
{{-- Table --}}
@forelse($reservations as $res) @php $resBalance = $res->balanceDue(); $resTotalPaid = $res->totalPaid(); $resTotalCharge = $res->totalCharges(); $isSettled = $resBalance <= 0; @endphp @empty @endforelse
Guest Room Charges Paid Balance

{{ $res->guest_name }}

{{ $res->booking_no }}

{{ $res->room_no }}

{{ $res->room_type }}

₱{{ number_format($resTotalCharge, 2) }}

@if($res->folioCharges->isNotEmpty())

incl. {{ $res->folioCharges->count() }} extra{{ $res->folioCharges->count() > 1 ? 's' : '' }}

@endif

₱{{ number_format($resTotalPaid, 2) }}

@if($isSettled) Settled @else

₱{{ number_format($resBalance, 2) }}

@endif
View Folio →

No billing records found.

@if($hasFilters) Clear filters to see all records @endif
@if($reservations->hasPages())
{{ $reservations->links() }}
@endif
@endsection