@extends('layouts.app') @section('title', 'Night Audit — ' . \Carbon\Carbon::parse($date)->format('M j, Y')) @section('nav_reports', 'bg-teal-50 text-teal-700 font-semibold') @section('page_title', 'Reports') @section('page_subtitle', 'Night Audit — ' . \Carbon\Carbon::parse($date)->format('l, F j, Y')) @section('content') {{-- ===== TABS + DATE PICKER ===== --}} @include('reports._toolbar', ['active' => 'night-audit', 'from' => $date, 'to' => $date, 'date' => $date]) {{-- ===== SUMMARY TILES ===== --}}

Arrivals

{{ $arrivals->count() }}

{{ $arrivals->where('status','checked_in')->count() }} checked in @if($arrivals->where('status','confirmed')->count() + $arrivals->where('status','pending')->count() > 0) · {{ $arrivals->whereIn('status',['confirmed','pending'])->count() }} expected @endif

Departures

{{ $departures->count() }}

{{ $departures->where('status','checked_out')->count() }} checked out @if($departures->where('status','checked_in')->count() > 0) · {{ $departures->where('status','checked_in')->count() }} still in house @endif

In House

{{ $inHouse->count() }}

guests currently checked in

Collected Today

₱{{ number_format($totalCollected, 0) }}

{{ $payments->count() }} payment{{ $payments->count() !== 1 ? 's' : '' }}

{{-- ===== LEFT 2/3: ARRIVALS + DEPARTURES ===== --}}
{{-- Arrivals --}}

Arrivals

{{ $arrivals->count() }} reservation{{ $arrivals->count() !== 1 ? 's' : '' }}
@if($arrivals->isEmpty())

No arrivals for this date.

@else
@foreach($arrivals as $res) @php $badge = match($res->status) { 'checked_in' => 'bg-green-50 text-green-700 border-green-200', 'confirmed' => 'bg-teal-50 text-teal-700 border-teal-200', 'pending' => 'bg-amber-50 text-amber-700 border-amber-200', default => 'bg-gray-50 text-gray-500 border-gray-200', }; $label = match($res->status) { 'checked_in' => 'Checked In', 'confirmed' => 'Confirmed', 'pending' => 'Pending', default => ucfirst($res->status), }; @endphp @endforeach
Guest Room Nights Amount Status
{{ $res->guest_name }}

{{ $res->booking_no }}

{{ $res->room_no }}

{{ $res->room_type }}

{{ $res->nights }} ₱{{ number_format($res->amount, 0) }} {{ $label }}
@endif
{{-- Departures --}}

Departures

{{ $departures->count() }} reservation{{ $departures->count() !== 1 ? 's' : '' }}
@if($departures->isEmpty())

No departures for this date.

@else
@foreach($departures as $res) @php $badge = match($res->status) { 'checked_out' => 'bg-gray-100 text-gray-500 border-gray-300', 'checked_in' => 'bg-amber-50 text-amber-700 border-amber-200', default => 'bg-gray-50 text-gray-500 border-gray-200', }; $label = match($res->status) { 'checked_out' => 'Checked Out', 'checked_in' => 'Still In House', default => ucfirst($res->status), }; @endphp @endforeach
Guest Room Amount Status
{{ $res->guest_name }}

{{ $res->booking_no }}

{{ $res->room_no }}

{{ $res->room_type }}

₱{{ number_format($res->amount, 0) }} {{ $label }}
@endif
{{-- ===== RIGHT 1/3: PAYMENTS + IN-HOUSE SUMMARY ===== --}}
{{-- Payment breakdown --}}

Payments Collected

₱{{ number_format($totalCollected, 0) }}

@if($byPaymentMethod->isEmpty())

No payments on this date.

@else
@foreach($byPaymentMethod as $method => $pm) @php $pmShare = $totalCollected > 0 ? round($pm['total'] / $totalCollected * 100) : 0; @endphp
{{ $method }} ₱{{ number_format($pm['total'], 0) }}
{{ $pm['count'] }} txn · {{ $pmShare }}%
@endforeach
@if($payments->count() > 0)

Transactions

@foreach($payments as $pmt)

{{ $pmt->reservation?->guest_name ?? '—' }}

{{ $pmt->method }}{{ $pmt->reference ? ' · ' . $pmt->reference : '' }}

₱{{ number_format($pmt->amount, 0) }}
@endforeach
@endif
{{-- In-House summary --}}

In House

{{ $inHouse->count() }}
@if($inHouse->isEmpty())

No guests in house.

@else
@foreach($inHouse as $res)
{{ $res->guest_name }}

{{ $res->room_no }} · out {{ \Carbon\Carbon::parse($res->check_out)->format('M j') }}

{{ $res->room_type }}
@endforeach
@endif
@endif
@endsection