@php $restaurant = $restaurant ?? $quotation->restaurant ?? $quotation->branch?->restaurant; $branch = $quotation->branch; $guest = $quotation->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($quotation->check_in_date)?->format($df); if ($quotation->check_in_time) { $arrivalAt .= ' ' . \Carbon\Carbon::parse($quotation->check_in_time)->format($tf); } $departureAt = optional($quotation->check_out_date)?->format($df); if ($quotation->check_out_time) { $departureAt .= ' ' . \Carbon\Carbon::parse($quotation->check_out_time)->format($tf); } $nights = 0; if ($quotation->check_in_date && $quotation->check_out_date) { $nights = max(0, $quotation->check_in_date->diffInDays($quotation->check_out_date)); if ($nights === 0) { $nights = 1; } } $statusLabel = $quotation->status?->label() ?? (string) $quotation->status; $roomsTotal = (float) $quotation->quotationRooms->sum('total_amount'); $extrasTotal = (float) $quotation->quotationExtras->sum('total_amount'); $grossSubtotal = $roomsTotal + $extrasTotal; $netAfterDiscount = (float) ($quotation->subtotal_before_tax ?? 0); $discountAmount = max(0, $grossSubtotal - $netAfterDiscount); $advancePaid = (float) ($quotation->advance_paid ?? 0); $balanceDue = max(0, (float) ($quotation->total_amount ?? 0) - $advancePaid); $headerBlue = '#3E7DA3'; $borderBlack = '#000000'; @endphp {{ __('hotel::modules.quotation.emailInvoiceTitle') }}
{{-- Header --}} {{-- Overview --}} {{-- Customer --}} {{-- Rooms --}} {{-- Extras --}} {{-- Financial summary --}} {{-- Footer --}}
@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.quotation.emailQuotationId') }}
{{ $quotation->quotation_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.quotation.status') }}
{{ $statusLabel }}
{{ __('hotel::modules.quotation.date') }}
{{ optional($quotation->created_at)->format($df) ?? '—' }}
{{ __('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($quotation->quotationRooms as $qr) @empty @endforelse
{{ __('hotel::modules.reservation.roomType') }} {{ __('hotel::modules.reservation.quantityShort') }} {{ __('hotel::modules.reservation.rate') }} {{ __('hotel::modules.reservation.total') }}
{{ $qr->roomType?->name ?? '—' }} {{ $qr->quantity ?? 0 }} {{ currency_format($qr->rate ?? 0) }} {{ currency_format($qr->total_amount ?? 0) }}
{{ __('hotel::modules.reservation.noRoomsSelected') }}
{{ __('hotel::modules.reservation.emailExtrasSection') }}
@forelse($quotation->quotationExtras as $qe) @empty @endforelse
{{ $qe->extraService?->name ?? '—' }} @if(($qe->quantity ?? 0) > 1) / {{ __('hotel::modules.reservation.quantityShort') }} {{ $qe->quantity }} @endif / {{ currency_format($qe->total_amount ?? 0) }} @if($qe->unit_price) — {{ __('hotel::modules.reservation.unitPrice') }} {{ currency_format($qe->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 = $quotation->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($quotation->tax_amount ?? 0) }} @endforelse
{{ __('hotel::modules.reservation.total') }}
{{ currency_format($quotation->total_amount ?? 0) }}
{{ __('hotel::modules.reservation.advancePaid') }}
{{ currency_format($advancePaid) }}
{{ __('hotel::modules.reservation.balanceDue') }}
{{ currency_format($balanceDue) }}
{{ __('hotel::modules.quotation.emailInvoiceFooter') }}