@php /** @var \App\Models\invoice\InvoiceServices|null $invoiceService */ /** @var \App\Models\Profile\Profile|null $profile */ /** @var \App\Models\General\Companies|null $company */ /** @var \App\Models\Profile\Customer|null $customer */ /** @var \App\Models\User|null $executive */ $profileNumber = $profile?->profile_number ?? '---'; $customerName = $customer?->full_name ?? '---'; $customerPhone = $customer?->phone ?? ''; $customerEmail = $customer?->email ?? ''; $companyName = $company?->currentTranslation?->name_company ?? $company?->name_company ?? 'Azora'; $companyTagline = 'Executive Travel Services & Transportation'; $companyPhone = $company?->companie_phone ?? $company?->companie_mobile ?? ''; $companyEmailAddr = $company?->companie_email ?? ''; $companyContact = trim(implode(' | ', array_filter([$companyPhone, $companyEmailAddr]))); $logoUrl = null; if ($company?->invoice_logo && file_exists(public_path($company->invoice_logo))) { $logoUrl = public_path($company->invoice_logo); } $brandParts = preg_split('/\s+/', trim($companyName), 2) ?: ['Azora']; $brandPrimary = $brandParts[0] ?? 'Azora'; $brandSecondary = $brandParts[1] ?? 'Travel'; $accommodationType = $invoiceService?->reservation?->accommodation?->type ?? 'hotel'; $isCruise = $accommodationType === 'cruise'; $badgeLabel = $isCruise ? 'Accommodation Cruise Voucher' : 'Accommodation Hotel Voucher'; $serviceTypeLabel = $isCruise ? 'Cruise' : 'Hotel'; $serviceMode = $isCruise ? 'Pre-Booked Cruise' : 'Pre-Booked Stay'; $serviceHeadRight = $isCruise ? 'Direct Cruise Service' : 'Direct Accommodation Service'; $rooms = $invoiceService?->reservation?->rooms ?? collect(); $rawCheckIn = $rooms->min('check_in'); $rawCheckOut = $rooms->max('check_out'); $checkIn = '---'; $checkOut = '---'; if ($rawCheckIn) { try { $checkIn = \Carbon\Carbon::parse($rawCheckIn)->format('Y-m-d'); } catch (\Throwable $e) { $checkIn = (string) $rawCheckIn; } } if ($rawCheckOut) { try { $checkOut = \Carbon\Carbon::parse($rawCheckOut)->format('Y-m-d'); } catch (\Throwable $e) { $checkOut = (string) $rawCheckOut; } } $firstRoom = $rooms->first(); $roomTypeName = $firstRoom?->roomType?->currentTranslation?->name ?? $firstRoom?->roomType?->name ?? '---'; $mealPlanName = $firstRoom?->mealPlan?->currentTranslation?->name ?? $firstRoom?->mealPlan?->name ?? '---'; $serviceTitle = $invoiceService?->reservation?->accommodation?->currentTranslation?->name ?? $invoiceService?->reservation?->accommodation?->name ?? $invoiceService?->service?->currentTranslation?->title ?? $invoiceService?->service?->title ?? ($isCruise ? 'Cruise' : 'Hotel'); $notes = trim((string) ($invoiceService?->notes ?? '')); $rawStatus = strtolower((string) ($invoiceService?->status ?? 'pending')); $statusMap = [ 'pending' => 'Pending Confirmation', 'draft' => 'Draft', 'confirmed' => 'Confirmed', 'done' => 'Completed', 'cancelled' => 'Cancelled', 'no_show' => 'No Show', 'refund' => 'Refunded', 'partial_refund' => 'Partially Refunded', ]; $statusLabel = $statusMap[$rawStatus] ?? ucfirst(str_replace('_', ' ', $rawStatus)); $statusBg = match (true) { in_array($rawStatus, ['confirmed', 'done'], true) => '#DCFCE7', in_array($rawStatus, ['cancelled', 'refund', 'no_show'], true) => '#FEE2E2', default => '#FEF3C7', }; $statusColor = match (true) { in_array($rawStatus, ['confirmed', 'done'], true) => '#166534', in_array($rawStatus, ['cancelled', 'refund', 'no_show'], true) => '#991B1B', default => '#92400E', }; $issuedDate = now()->format('Y-m-d'); $executiveName = $executive?->name ?? '---'; $executiveId = $executive?->employee_number ?? $executive?->id ?? '---'; $executiveEmail = $executive?->email ?? '---'; @endphp
Please present this voucher and a valid ID at check-in. {{ $companyContact !== '' ? $companyContact : 'Support' }}
{{-- Header --}}
@if ($logoUrl) Logo @else
A
@endif
{{ $brandPrimary }} {{ $brandSecondary }}
{{ $companyTagline }}
{{ $badgeLabel }}
Issued Date: {{ $issuedDate }}
 
{{-- Customer + Booking --}}
P Customer Information
Primary Guest
{{ $customerName }}
Profile / Account Number
{{ $profileNumber }}
Contact Details
@if ($customerPhone !== '' || $customerEmail !== '') @if ($customerPhone !== '') {{ $customerPhone }} @endif @if ($customerPhone !== '' && $customerEmail !== '') / @endif @if ($customerEmail !== '') {{ $customerEmail }} @endif @else --- @endif
R Booking Reference
Service Type
{{ $serviceTypeLabel }}
Voucher Status
{{ $statusLabel }}
Service Mode
{{ $serviceMode }}
 
{{-- Service Details --}}
Service Details {{ $serviceHeadRight }}
Service Title Check In Check Out Room Type Meal Type
{{ $serviceTitle }} {{ $checkIn }} {{ $checkOut }} {{ $roomTypeName }} {{ $mealPlanName }}
{{ $notes }}
 
{{-- Assigned Specialist --}}
S Assigned Specialist
{{ $executiveName }}
Employee ID: #{{ $executiveId }}
{{ $executiveEmail }}
Corporate Travel Department {{ $companyName }}
 
{{-- Important notice --}}
Important Check-In Requirement: A valid photo ID matching the guest name is required at check-in. Changes must be requested at least 24 hours before arrival.