@extends('layouts.admin') @section('title', 'Reservation '.$reservation->number) @section('content') Edit @if($reservation->invoices->isNotEmpty()) Invoice @endif @if($reservation->folios->isNotEmpty()) Charges @endif @if(!in_array($reservation->status, ['cancelled','checked_out'], true))
@csrf
@endif
{{-- Stay details --}}
Stay Details
Check-in
{{ $reservation->check_in_date?->format('M j, Y') }}
Check-out
{{ $reservation->check_out_date?->format('M j, Y') }}
Nights
{{ $reservation->nights }}
Rooms
{{ max(1, $reservation->reservationRooms->count()) }}
Occupants
{{ $reservation->adults }} adult(s), {{ $reservation->children }} child(ren)
Status
Source
{{ ucfirst(str_replace('_', ' ', $reservation->source ?? 'direct')) }}
@if($reservation->special_requests)
Special requests
{{ $reservation->special_requests }}
@endif
{{-- Rooms on this reservation --}}
Rooms
@php $roomLines = $reservation->reservationRooms; if ($roomLines->isEmpty()) { $roomLines = collect([(object) [ 'roomType' => $reservation->roomType, 'room' => $reservation->room, 'package' => $reservation->package, 'adults' => $reservation->adults, 'children' => $reservation->children, 'total_amount' => $reservation->total_amount, ]]); } @endphp
@foreach($roomLines as $line)
{{ $line->roomType?->name ?? 'Room type' }}
Room {{ $line->room?->number ?? 'Unassigned' }} @if($line->package) · {{ $line->package->name }} @endif · {{ $line->adults }} adult(s), {{ $line->children }} child(ren)
{{ $currency }} {{ number_format($line->total_amount ?? 0, 2) }}
@endforeach
{{-- Guest details --}}
Guest Details @if($reservation->guest) View profile @endif
@if($reservation->guest) @php $g = $reservation->guest; @endphp
Full name
{{ trim(($g->title ? $g->title.' ' : '').$g->first_name.' '.($g->middle_name ? $g->middle_name.' ' : '').$g->last_name) }}
VIP
{{ $g->is_vip ? 'Yes' : 'No' }}
Loyalty points
{{ number_format($g->loyalty_points ?? 0) }}
Phone
{{ $g->phone ?: '—' }}
Email
{{ $g->email ?: '—' }}
Nationality
{{ $g->nationality ?: '—' }}
ID / Passport
{{ $g->national_id ?: ($g->passport_number ?: '—') }}
Company
{{ $g->company ?: '—' }}
Address
{{ collect([$g->address, $g->city, $g->country])->filter()->implode(', ') ?: '—' }}
@if($reservation->corporateAccount)
Corporate account
{{ $reservation->corporateAccount->company_name }}
@endif @if($reservation->travelAgent)
Travel agent
{{ $reservation->travelAgent->agency_name }}
@endif
@else

No guest linked.

@endif
@if($reservation->folios->isNotEmpty()) @endif
{{-- Billing summary --}}
Billing
Subtotal{{ $currency }} {{ number_format($reservation->subtotal, 2) }}
Discount{{ $currency }} {{ number_format($reservation->discount, 2) }}
Tax{{ $currency }} {{ number_format($reservation->tax, 2) }}
Service charge{{ $currency }} {{ number_format($reservation->service_charge, 2) }}

Total{{ $currency }} {{ number_format($reservation->total_amount, 2) }}
Paid{{ $currency }} {{ number_format($paidTotal, 2) }}
Balance{{ $currency }} {{ number_format($reservation->balance, 2) }}
Payment status:
@if($reservation->invoices->isNotEmpty())
Invoice: @foreach($reservation->invoices as $inv) {{ $inv->number }}@if(!$loop->last), @endif @endforeach
@endif
{{-- Payments card --}}
Payments
@if($reservation->payments->isEmpty())

No payments recorded yet.

@else
@foreach($reservation->payments->sortByDesc('transaction_date') as $payment)
{{ $currency }} {{ number_format($payment->amount, 2) }}
{{ ucfirst(str_replace('_',' ', $payment->method)) }} · {{ $payment->reference }}
{{ $payment->transaction_date?->format('M j, Y H:i') }}
@endforeach
@endif
@if($reservation->folios->isNotEmpty() && $reservation->balance > 0 && !in_array($reservation->status, ['cancelled'], true))
@csrf
@endif
@endsection