@php $restaurant = $restaurant ?? $reservation->restaurant ?? $reservation->branch?->restaurant; $branch = $reservation->branch; $guest = $reservation->primaryGuest; $companyTitle = $restaurant?->name ?? config('app.name'); if ($branch?->name && $branch->name !== ($restaurant?->name ?? '')) { $companyTitle .= ' (' . $branch->name . ')'; } $companyAddress = $branch?->address ?? ''; $companyPhone = $branch?->phone ?? ''; $companyEmail = $branch?->email ?? ''; $companyWebsite = data_get($restaurant, 'google_business_link'); $df = function_exists('dateFormat') ? dateFormat() : 'd-m-Y'; $tf = function_exists('timeFormat') ? timeFormat() : 'H:i'; $arrivalAt = optional($reservation->check_in_date)?->format($df); if ($reservation->check_in_time) { $arrivalAt .= ' ' . \Carbon\Carbon::parse($reservation->check_in_time)->format($tf); } $departureAt = optional($reservation->check_out_date)?->format($df); if ($reservation->check_out_time) { $departureAt .= ' ' . \Carbon\Carbon::parse($reservation->check_out_time)->format($tf); } $nights = 0; if ($reservation->check_in_date && $reservation->check_out_date) { $nights = max(0, $reservation->check_in_date->diffInDays($reservation->check_out_date)); if ($nights === 0) { $nights = 1; } } $actualCheckIn = $reservation->stays->first()?->check_in_at; $actualCheckInStr = $actualCheckIn ? $actualCheckIn->format($df . ' ' . $tf) : '—'; $statusLabel = $reservation->status?->label() ?? (string) $reservation->status; $roomsTotal = (float) $reservation->reservationRooms->sum('total_amount'); $extrasTotal = (float) $reservation->reservationExtras->sum('total_amount'); $grossSubtotal = $roomsTotal + $extrasTotal; $netAfterDiscount = (float) ($reservation->subtotal_before_tax ?? 0); $discountAmount = max(0, $grossSubtotal - $netAfterDiscount); $advancePaid = (float) ($reservation->advance_paid ?? 0); $folioPayments = $reservation->stays?->flatMap(fn ($s) => $s->folio ? $s->folio->folioPayments : collect()) ?? collect(); $advanceAlreadyApplied = $folioPayments->contains(fn ($p) => ($p->payment_method ?? null) === 'advance'); $totalPaid = (float) ($advanceAlreadyApplied ? $folioPayments->sum('amount') : ($advancePaid + $folioPayments->sum('amount'))); $balanceDue = max(0, (float) ($reservation->total_amount ?? 0) - $totalPaid); $headerBlue = '#3E7DA3'; $borderBlack = '#000000'; @endphp {{ __('hotel::modules.reservation.reservationReceiptTitle') }}
{{-- Header --}} {{-- Booking overview --}} {{-- Customer --}} {{-- Rooms --}} {{-- Extras --}} {{-- Financial summary --}} {{-- Payments --}} {{-- Footer terms --}}
@if($restaurant && $restaurant->logo_url) @endif
{{ $companyTitle }}
@if($companyAddress)
{{ $companyAddress }}
@endif
@if($companyPhone)
{{ __('hotel::modules.reservation.emailContactPhone') }}: {{ $companyPhone }}
@endif @if($companyEmail)
{{ __('hotel::modules.reservation.emailContactEmail') }}: {{ $companyEmail }}
@endif @if($companyWebsite)
{{ __('hotel::modules.reservation.emailContactWebsite') }}: {{ $companyWebsite }}
@endif
{{ __('hotel::modules.reservation.emailBookingId') }}
{{ $reservation->reservation_number }}
{{ __('hotel::modules.reservation.emailArrivalDateTime') }}
{{ $arrivalAt ?: '—' }}
{{ __('hotel::modules.reservation.emailDepartureDateTime') }}
{{ $departureAt ?: '—' }}
{{ __('hotel::modules.reservation.emailNights') }}
{{ $nights }} {{ $nights === 1 ? __('hotel::modules.reservation.emailNightSingular') : __('hotel::modules.reservation.emailNightPlural') }}
{{ __('hotel::modules.reservation.emailCheckInActual') }}
{{ $actualCheckInStr }}
{{ __('hotel::modules.reservation.status') }}
{{ $statusLabel }}
{{ __('hotel::modules.reservation.emailCustomerSection') }}
{{ __('hotel::modules.reservation.emailCustomerName') }} {{ $guest?->full_name ?? '—' }}
{{ __('hotel::modules.reservation.emailCustomerAddress') }} {{ $guest?->address ? $guest->address : '—' }}
{{ __('hotel::modules.reservation.emailMobile') }} {{ $guest?->phone ?? '—' }}
{{ __('hotel::modules.reservation.emailRoomsSection') }}
@forelse($reservation->reservationRooms as $rr) @empty @endforelse
{{ __('hotel::modules.reservation.emailAccommodationType') }} {{ __('hotel::modules.reservation.emailRoomNumber') }} {{ __('hotel::modules.reservation.emailNoOfAdults') }} {{ __('hotel::modules.reservation.emailNoOfChildren') }} {{ __('hotel::modules.reservation.emailPricePerNight') }} {{ __('hotel::modules.reservation.total') }}
{{ $rr->roomType?->name ?? '—' }} {{ $rr->room?->room_number ?? '—' }} {{ $reservation->adults ?? 0 }} {{ $reservation->children ?? 0 }} {{ currency_format($rr->rate ?? 0) }} {{ currency_format($rr->total_amount ?? 0) }}
{{ __('hotel::modules.reservation.noRoomsSelected') }}
{{ __('hotel::modules.reservation.emailExtrasSection') }}
@forelse($reservation->reservationExtras as $re) @empty @endforelse
{{ $re->extraService?->name ?? '—' }} @if(($re->quantity ?? 0) > 1) / {{ __('hotel::modules.reservation.quantityShort') }} {{ $re->quantity }} @endif / {{ currency_format($re->total_amount ?? 0) }} @if($re->unit_price) — {{ __('hotel::modules.reservation.unitPrice') }} {{ currency_format($re->unit_price) }} @endif
{{ __('hotel::modules.reservation.roomsPrice') }}
{{ currency_format($roomsTotal) }}
{{ __('hotel::modules.reservation.extrasPrice') }}
{{ currency_format($extrasTotal) }}
{{ __('hotel::modules.reservation.discount') }}
{{ currency_format($discountAmount) }}
@php $invoiceTaxLines = $reservation->invoiceTaxes(); @endphp @forelse($invoiceTaxLines as $line)
{{ $line['tax']->name ?? __('hotel::modules.reservation.bookingTax') }} @if($line['tax']->rate !== null && (float) $line['tax']->rate != 0) ({{ $line['tax']->rate }}%) @endif
{{ currency_format($line['amount']) }}
@empty {{ __('hotel::modules.reservation.bookingTax') }}
{{ currency_format($reservation->tax_amount ?? 0) }} @endforelse
{{ __('hotel::modules.reservation.total') }}
{{ currency_format($reservation->total_amount ?? 0) }}
{{ __('hotel::modules.reservation.emailTotalPaid') }}
{{ currency_format($totalPaid) }}
{{ __('hotel::modules.reservation.emailDue') }}
{{ currency_format($balanceDue) }}
{{ __('hotel::modules.reservation.emailPaymentInfo') }}
@php $payIndex = 0; @endphp @forelse($folioPayments->sortBy('created_at')->values() as $payment) @php $payIndex++; @endphp @empty @if($advancePaid > 0 && !$advanceAlreadyApplied) @php $payIndex = 1; @endphp @else @endif @endforelse
# {{ __('hotel::modules.reservation.date') }} {{ __('hotel::modules.reservation.emailReferenceNo') }} {{ __('hotel::modules.reservation.amount') }} {{ __('hotel::modules.reservation.emailPaymentMode') }} {{ __('hotel::modules.reservation.emailPaymentNote') }}
{{ $payIndex }} {{ optional($payment->created_at)->format($df) ?? '—' }} {{ $payment->transaction_reference ?? '—' }} {{ currency_format($payment->amount ?? 0) }} {{ ucfirst((string) ($payment->payment_method ?? '—')) }} {{ $payment->notes ? $payment->notes : '—' }}
1 {{ optional($reservation->created_at)->format($df) ?? '—' }} {{ currency_format($advancePaid) }} {{ __('hotel::modules.reservation.advance') }}
{{ __('hotel::modules.reservation.noPaymentsRecorded') }}
{{ __('hotel::modules.reservation.emailTermsFooter') }}
{{ __('hotel::modules.reservation.reservationCreatedEmailFooter') }}