@extends('layouts.app') @section('title', 'Group Booking ' . $group->group_no) @section('page_title', $group->group_no) @section('page_subtitle', 'Group booking for ' . $group->guest_name) @section('nav_reservations', 'bg-teal-50 text-teal-700 font-semibold') @section('content') @if (session('success'))

{{ session('success') }}

@endif @php $reservations = $group->reservations; $nights = $group->check_in->diffInDays($group->check_out); $totalAmount = $group->totalAmount(); $totalPaid = $group->totalPaid(); $balanceDue = max(0, $totalAmount - $totalPaid); $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 --}}
Back to Reservations
{{-- Header card --}}

{{ $group->group_no }}

Group Booking

{{ $reservations->count() }} rooms ยท {{ $nights }}N

Check-in

{{ $group->check_in->format('M j, Y') }}

Check-out

{{ $group->check_out->format('M j, Y') }}

Grand Total

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

{{-- Guest info bar --}}
{{ strtoupper(substr($group->guest_name, 0, 1)) }}{{ strtoupper(substr(explode(' ', $group->guest_name)[1] ?? 'X', 0, 1)) }}

{{ $group->guest_name }}

@if($group->guest_phone)

{{ $group->guest_phone }}

@endif
@if($group->guest_email)

{{ $group->guest_email }}

@endif @if($group->notes)

{{ $group->notes }}

@endif {{-- Payment summary --}}

Paid

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

Balance

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

{{-- Rooms table --}}

Rooms in this Group

{{ $reservations->count() }}
@foreach ($reservations as $res) @php $paid = $res->totalPaid(); $charges = $res->totalCharges(); $bal = $res->balanceDue(); @endphp @endforeach
Booking # Room Type Rate/Night Room Total Paid Balance Status Action
{{ $res->booking_no }}

Room {{ $res->room_no }}

{{ $res->room_type }}

₱{{ number_format($res->rate, 0) }}

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

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

@if ($bal > 0)

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

@else Settled @endif
{{ $statusLabel[$res->status] ?? ucfirst($res->status) }}
@if (in_array($res->status, ['confirmed', 'pending']))
@csrf
@elseif ($res->status === 'checked_in') Check Out @endif View
Total ₱{{ number_format($totalAmount, 0) }} ₱{{ number_format($totalPaid, 0) }} ₱{{ number_format($balanceDue, 0) }}

Payments and folio charges are managed per room. Click View on each room to add payments or extra charges.

@endsection