@extends('layouts.app') @section('title', 'Reservation Details') @section('page_title', $reservation['booking_no']) @section('page_subtitle', 'Reservation details for ' . $reservation['guest_name']) @section('nav_reservations', 'bg-teal-50 text-teal-700 font-semibold') @section('content') @if (session('success'))

{{ session('success') }}

@endif @if (session('error'))

{{ session('error') }}

@endif @php $statusBadge = [ 'pending' => 'bg-amber-50 text-amber-700 border-[0.5px] border-amber-200', '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', 'cancelled' => 'bg-red-50 text-red-600 border-[0.5px] border-red-200', 'no_show' => 'bg-orange-50 text-orange-600 border-[0.5px] border-orange-200', ]; $statusLabel = [ 'pending' => 'Pending', 'confirmed' => 'Confirmed', 'checked_in' => 'Checked In', 'checked_out' => 'Checked Out', 'cancelled' => 'Cancelled', 'no_show' => 'No Show', ]; @endphp
{{-- Back + Actions --}}
Back to Reservations
@if ($reservation['status'] === 'pending')
@csrf
@endif @if (in_array($reservation['status'], ['confirmed', 'pending']))
@csrf
@endif @if ($reservation['status'] === 'checked_in') Check Out Guest @endif @if ($reservation['status'] === 'checked_in' && $availableRooms->isNotEmpty()) @endif Folio Edit @if (in_array($reservation['status'], ['pending', 'confirmed', 'checked_in']))
@if ($reservation['status'] === 'checked_in')
@csrf
@endif @if (in_array($reservation['status'], ['confirmed', 'pending']))
@csrf
@endif
@csrf
@endif @if ($reservation['status'] === 'checked_out')
@csrf
@endif @if (in_array($reservation['status'], ['cancelled', 'no_show']))
@csrf
@endif {{-- Transfer Room Modal --}} @if ($reservation['status'] === 'checked_in' && $availableRooms->isNotEmpty()) @php $roomsByFloor = $availableRooms->groupBy('floor')->sortKeys(); @endphp
{{-- Modal header --}}

Transfer Room

{{ $reservation['guest_name'] }} — currently in Room {{ $reservation['room_no'] }}

@csrf {{-- Scrollable room list --}}
{{-- Room picker --}}
@foreach ($roomsByFloor as $floor => $floorRooms)

Floor {{ $floor }}

@foreach ($floorRooms as $room) @endforeach
@endforeach
{{-- Reason --}}
{{-- Notes --}}
{{-- Rate difference notice --}}

Room rate and billing are not changed automatically. If there is a rate difference, add a folio charge to the reservation after transferring.

{{-- Modal footer --}}
@endif
{{-- Group Booking Banner --}} @if ($reservation->group_id) @php $group = $reservation->group; $siblings = $group->reservations->where('id', '!=', $reservation->id); $groupNights = $group->check_in->diffInDays($group->check_out); @endphp

Part of Group Booking {{ $group->group_no }}

{{ $group->reservations->count() }} rooms total @if ($siblings->count()) — other rooms: @foreach ($siblings as $sib) Room {{ $sib->room_no }}{{ !$loop->last ? ', ' : '' }} @endforeach @endif

View Group →
@endif
{{-- LEFT: Main (2/3) --}}
{{-- Overview Card --}}

{{ $reservation['booking_no'] }}

{{ $statusLabel[$reservation['status']] ?? $reservation['status'] }}

Booked via {{ $reservation['source'] }}

Total Amount

₱{{ number_format($reservation['amount'], 2) }}

@if($reservation->ratePlan)

Rate Plan

{{ $reservation->ratePlan->code }} {{ $reservation->ratePlan->name }} — {{ $reservation->ratePlan->modifierLabel() }}
@endif

Check-in

{{ \Carbon\Carbon::parse($reservation['check_in'])->format('D, M j, Y') }}

After 2:00 PM

Check-out

{{ \Carbon\Carbon::parse($reservation['check_out'])->format('D, M j, Y') }}

Before 12:00 PM

Duration

{{ $reservation['nights'] }} Night{{ $reservation['nights'] > 1 ? 's' : '' }}

{{ $reservation['pax'] }} Guest{{ $reservation['pax'] > 1 ? 's' : '' }}

{{-- Room --}}

Room Details

Room {{ $reservation['room_no'] }}

{{ $reservation['room_type'] }}

₱{{ number_format($reservation['rate'], 0) }} / night

{{-- Charges Breakdown --}} @php $catLabels = ['food_beverage' => 'Food & Bev.', 'laundry' => 'Laundry', 'telephone' => 'Telephone', 'minibar' => 'Minibar', 'damage' => 'Damage', 'other' => 'Misc.']; $canAddCharge = !in_array($reservation['status'], ['cancelled', 'no_show']); $totalExtras = $charges->sum('amount'); $totalGross = (float) $reservation['amount'] + $totalExtras; $vatPct = (int) \App\Models\Setting::get('vat_rate', 12); $preVatTotal = $totalGross / (1 + $vatPct / 100); $vatOnTotal = $totalGross - $preVatTotal; @endphp
{{-- Header + room line --}}

Charges Breakdown

@if($canAddCharge) @endif
Room {{ $reservation['room_no'] }} — Accommodation ₱{{ number_format($reservation['amount'], 2) }}
{{ $reservation['nights'] }} night{{ $reservation['nights'] > 1 ? 's' : '' }} @ ₱{{ number_format($reservation['rate'], 0) }}/night
{{-- Extra charges list --}} @if($charges->isNotEmpty())
@foreach($charges as $ch)
{{ $ch->description }} {{ $catLabels[$ch->category] ?? $ch->category }} @if($ch->quantity > 1) × {{ $ch->quantity }} @endif · {{ $ch->charge_date->format('M j') }} @if($ch->fromPos()) POS #{{ $ch->pos_transaction_id }} @endif
₱{{ number_format($ch->amount, 2) }} @if($canAddCharge)
@csrf @method('DELETE')
@endif
@endforeach
@endif {{-- VAT breakdown + total --}}
Subtotal (excl. VAT {{ $vatPct }}%) ₱{{ number_format($preVatTotal, 2) }}
VAT ({{ $vatPct }}%) ₱{{ number_format($vatOnTotal, 2) }}
Total Charges ₱{{ number_format($totalGross, 2) }}
{{-- Add charge form --}} @if($canAddCharge)

Add Extra Charge

@csrf
@endif
{{-- Payments --}} @php $totalPaid = $payments->sum('amount'); $totalCharge = $totalGross; // room + extra charges $balance = max(0, $totalCharge - $totalPaid); $paidPct = $totalCharge > 0 ? min(100, round($totalPaid / $totalCharge * 100)) : 0; $canAddPay = !in_array($reservation['status'], ['checked_out', 'cancelled', 'no_show']); @endphp
{{-- Summary bar --}}

Payments

@if($canAddPay) @endif
{{-- Three-way summary --}}

Charges

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

Paid

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

Balance

{{ $balance > 0 ? '₱'.number_format($balance, 2) : 'Settled' }}

{{-- Progress bar --}}
{{-- Payment records list --}} @if($payments->isNotEmpty())
@foreach($payments as $pmt)
₱{{ number_format($pmt->amount, 2) }} {{ $pmt->method }}
{{ $pmt->payment_date->format('M j, Y') }} @if($pmt->reference) · {{ $pmt->reference }} @endif
@if($canAddPay)
@csrf @method('DELETE')
@endif
@endforeach
@else
No payments recorded yet.
@endif {{-- Add payment form --}} @if($canAddPay)

Record Payment

@csrf {{-- Running total + add row --}}

Total:

@endif
{{-- Notes --}} @if ($reservation['notes'])

Special Request

{{ $reservation['notes'] }}

@endif
{{-- RIGHT: Guest + Activity (1/3) --}}
{{-- Guest Card --}}

Guest Information

{{ strtoupper(substr($reservation['guest_name'], 0, 1)) }}{{ strtoupper(substr(explode(' ', $reservation['guest_name'])[1] ?? 'X', 0, 1)) }}

{{ $reservation['guest_name'] }}

Primary Guest

{{ $reservation['guest_email'] }}
{{ $reservation['guest_phone'] }}
{{ $reservation['pax'] }} Guest{{ $reservation['pax'] > 1 ? 's' : '' }}
{{-- Reminders Card --}}

Reminders

@if ($reminders->where('status', 'pending')->count() > 0) {{ $reminders->where('status', 'pending')->count() }} pending @endif
{{-- Existing reminders --}} @if ($reminders->isEmpty())

No reminders yet.

@else
@foreach ($reminders as $reminder)
@if ($reminder->status === 'done') @else @endif {{ $reminder->type }}

{{ $reminder->remind_at->format('M j, Y g:i A') }}

@if ($reminder->notes)

{{ $reminder->notes }}

@endif
@if ($reminder->status === 'pending')
@csrf
@endif
@csrf @method('DELETE')
@endforeach
@endif {{-- Add reminder form --}}
@csrf
{{-- Activity Log --}}

Activity Log

@php $colorBg = ['teal'=>'bg-teal-100','blue'=>'bg-blue-100','green'=>'bg-green-100','red'=>'bg-red-100','amber'=>'bg-amber-100','purple'=>'bg-purple-100','gray'=>'bg-gray-100']; $colorDot = ['teal'=>'bg-teal-500','blue'=>'bg-blue-500','green'=>'bg-green-500','red'=>'bg-red-400','amber'=>'bg-amber-500','purple'=>'bg-purple-500','gray'=>'bg-gray-400']; @endphp @if($activityLogs->isEmpty())

No activity recorded yet.

@else
@foreach($activityLogs as $log) @php $c = $log->color(); @endphp
@if(!$loop->last)
@endif

{{ $log->description }}

{{ $log->user_name ?? 'System' }} · {{ $log->created_at->diffForHumans() }}

@endforeach
@endif
@endsection