@extends('layouts.admin') @section('title', $booking->booking_no) @push('styles') @endpush @section('content') @include('admin.resorts.errors') @use('App\Services\Resort\ResortPresenter') @php $canDo = fn ($route) => auth()->user()->hasRole('super-admin') || auth()->user()->hasPermission($route); $label = fn ($status) => ucwords(strtolower(str_replace('_', ' ', $status))); $nextStatuses = \App\Services\Resort\ResortBookingStatusService::TRANSITIONS[$booking->status] ?? []; $due = max(0, $booking->grand_total - $booking->paid); $payable = in_array($booking->status, \App\Services\Resort\ResortPaymentService::PAYABLE) && $due > 0 && $canDo('admin.resort-bookings.payment'); $refundable = $booking->paid - $booking->refunded > 0 && $canDo('admin.resort-bookings.refund'); $editable = in_array($booking->status, \App\Services\Resort\ResortBookingService::EDITABLE) && $canDo('admin.resort-bookings.edit'); $paidPercent = $booking->grand_total > 0 ? min(100, round($booking->paid * 100 / $booking->grand_total)) : 0; $money = fn ($value) => number_format((float) $value, 2); @endphp

{{ $booking->booking_no }} {{ $booking->status }} {{ $booking->payment_status }}

{{ $booking->resort_name }}
Supplier: {{ $booking->supplier?->name ?? 'Own resort' }} · Source: {{ $label($booking->booking_source) }} · Created {{ $booking->created_at->format('d M Y, h:i A') }}
@if($editable)Edit Booking@endif @if($canDo('admin.resort-bookings.invoice'))Download Invoice PDF@endif @if($canDo('admin.resort-bookings.invoice-email'))
@csrf
@endif
Stay{{ \Carbon\Carbon::parse($booking->check_in)->format('d M Y') }} → {{ \Carbon\Carbon::parse($booking->check_out)->format('d M Y') }}
{{ $booking->check_in }} → {{ $booking->check_out }} · {{ $booking->nights }} nights · {{ $booking->total_rooms }} rooms · {{ $booking->total_adults }} adults, {{ $booking->total_children }} children
@if(in_array($booking->status, ['PAYMENT_PENDING', 'AVAILABILITY_CONFIRMED']))
@if($booking->hold_expires_at)Hold expires: {{ $booking->hold_expires_at->format('d M Y, h:i A') }}@elseRooms held with no expiry @endif
@endif
Guest{{ $booking->customer_details['name'] }}
{{ $booking->customer_details['phone'] }}@if(!empty($booking->customer_details['email'])) · {{ $booking->customer_details['email'] }}@endif
@if(!empty($booking->customer_details['address']))
{{ $booking->customer_details['address'] }}
@endif
Payment{{ $money($booking->paid) }} / {{ $money($booking->grand_total) }} {{ $booking->currency }}
Due: {{ number_format($due, 2) }}@if($booking->refunded > 0) · Refunded: {{ $money($booking->refunded) }}@endif
@if($booking->special_request)

Special request: {{ $booking->special_request }}

@endif @if($booking->admin_note)

Admin note: {{ $booking->admin_note }}

@endif @if($booking->cancelled_at)

Cancelled {{ $booking->cancelled_at->format('d M Y, h:i A') }}: {{ $booking->cancellation_reason }}

@endif
Rooms & Charges
@foreach($booking->rooms as $room)
{{ $room->room_name }} × {{ $room->quantity }}
@if($costAccess)@endif@foreach($room->nightly_prices as $night)@if($costAccess)@endif@endforeach
NightUnit rateExtrasTotalUnit cost
{{ $night['date'] }}{{ $night['selling_price'] }}{{ $night['extras'] }}{{ $night['total'] }}{{ $night['cost_price'] }}
@endforeach
@foreach(['subtotal','extras','discount','tax','service_charge','grand_total','paid','refunded'] as $key)
{{ ucwords(str_replace('_',' ',$key)) }}{{ $booking->$key }}
@endforeach @if($costAccess)
Supplier Cost:{{ $booking->supplier_cost }}
Record supplier settlement
@endif @if(\App\Http\Controllers\Admin\ResortController::allowed('profit'))
Gross Profit:{{ $booking->gross_profit }}
@endif
Status Change
@if($nextStatuses)
@csrf
@else

No further status changes apply to this booking.

@endif
Payments & Refunds
@if($payable)
Record Offline Payment
@if($methods->isEmpty())

No active offline payment method is set up, so a receipt cannot be recorded yet.

@else
@csrf
@endif @endif @if($refundable)
Record Completed Offline Refund

Issue the refund through your payment provider or bank first, then record its receipt here.

@csrf
@endif
@forelse($payments as $payment) @php $isRefund = $payment->source_type === 'resort_booking_refund'; $offline = $payment->gateway === 'offline'; $voided = $offline && $payment->status === 'cancelled'; $canEdit = $offline && $payment->status === 'paid' && $canDo('admin.resort-bookings.payment-update'); $canVoid = $offline && $payment->status === 'paid' && $canDo('admin.resort-bookings.payment-void'); $recorder = $payment->meta['recorded_by'] ?? null; @endphp @empty @endforelse
DateTypeMethodReceipt referenceAmountStatusRecorded by
{{ ($payment->paid_at ?? $payment->created_at)->format('d M Y') }}
{{ $payment->transaction_no }}
{{ $isRefund ? 'Refund' : 'Payment' }} {{ $payment->paymentMethod?->name ?? ($offline ? '—' : ucfirst($payment->gateway)) }} {{ $payment->meta['reference'] ?? $payment->gateway_transaction_id }}@if(!empty($payment->meta['note']))
{{ $payment->meta['note'] }}
@endif @if($voided && !empty($payment->meta['void_reason']))
Voided: {{ $payment->meta['void_reason'] }}
@endif
{{ $isRefund ? '−' : '' }}{{ $money($payment->amount) }} {{ $voided ? 'voided' : $payment->status }} {{ $recorder ? ($actors[$recorder] ?? 'User #'.$recorder) : ($offline ? '—' : 'Online') }} @if($canEdit)@endif @if($canVoid)@endif
No payments recorded yet.
@foreach($payments as $payment) @continue($payment->gateway !== 'offline' || $payment->status !== 'paid') @php $isRefund = $payment->source_type === 'resort_booking_refund'; // A method switched off since the payment was taken still has to be selectable for it. $methodOptions = $payment->paymentMethod && ! $methods->contains('id', $payment->payment_method_id) ? $methods->concat([$payment->paymentMethod]) : $methods; @endphp @if($canDo('admin.resort-bookings.payment-update')) @endif @if($canDo('admin.resort-bookings.payment-void')) @endif @endforeach
Status & Audit History
@endsection