@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 ?? ''; $companyEmail = $company?->companie_email ?? ''; $companyContact = trim(implode(' | ', array_filter([$companyPhone, $companyEmail]))); $logoUrl = null; if ($company?->invoice_logo && file_exists(public_path($company->invoice_logo))) { $logoUrl = public_path($company->invoice_logo); } $type = (string) ($invoiceService?->travel_tourism_type ?? ''); $serviceTitle = $invoiceService?->service?->currentTranslation?->title ?? $invoiceService?->service?->title ?? 'Service'; $typeLabels = [ 'additional_services' => 'Additional Service', 'single_transportation' => 'Single Transportation', 'daily_transportation' => 'Daily Transportation', 'tour_reps' => 'Tour Representative', 'tour_guide' => 'Tour Guide', 'attractions_temples' => 'Attractions & Temples', 'dining_entertainment' => 'Dining & Entertainment', 'visa' => 'Visa', 'flights' => 'Flight', 'accommodation' => 'Accommodation', ]; $serviceTypeLabel = $typeLabels[$type] ?? str_replace('_', ' ', ucfirst($type ?: 'Service')); $serviceDateRaw = match ($type) { 'additional_services', 'single_transportation' => $invoiceService?->execution_date, 'visa' => $invoiceService?->execution_date ?? $invoiceService?->date, default => $invoiceService?->execution_date ?? $invoiceService?->date, }; try { $serviceDate = $serviceDateRaw ? \Carbon\Carbon::parse($serviceDateRaw)->format('Y-m-d') : '---'; } catch (\Throwable $e) { $serviceDate = $serviceDateRaw ?: '---'; } $peopleLabel = '---'; if ($invoiceService) { if (in_array($type, ['additional_services', 'daily_transportation', 'single_transportation', 'tour_reps', 'tour_guide'], true)) { $peopleCount = (int) ($invoiceService->people_count ?? 0); $peopleLabel = $peopleCount > 0 ? $peopleCount.' '.($peopleCount === 1 ? 'Guest' : 'Guests') : '---'; } elseif (in_array($type, ['attractions_temples', 'dining_entertainment'], true)) { $adults = (int) ($invoiceService->adults_count ?? 0); $children = (int) ($invoiceService->children_count ?? 0); $parts = []; if ($adults) { $parts[] = $adults.' '.($adults === 1 ? 'Adult' : 'Adults'); } if ($children) { $parts[] = $children.' '.($children === 1 ? 'Child' : 'Children'); } $peopleLabel = $parts !== [] ? implode(' - ', $parts) : '---'; } elseif ($type === 'visa') { $peopleCount = (int) ($invoiceService->pax_number ?? 0); $peopleLabel = $peopleCount > 0 ? $peopleCount.' '.($peopleCount === 1 ? 'Pax' : 'Pax') : '---'; } } $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)); $statusClass = match (true) { in_array($rawStatus, ['confirmed', 'done'], true) => 'status-badge status-badge-ok', in_array($rawStatus, ['cancelled', 'refund', 'no_show'], true) => 'status-badge status-badge-danger', default => 'status-badge', }; $serviceMode = match ($type) { 'single_transportation', 'daily_transportation' => 'Pre-Booked Transport', 'tour_guide', 'tour_reps' => 'Guided Service', 'visa' => 'Visa Processing', 'dining_entertainment' => 'Hospitality Service', 'attractions_temples' => 'Excursion Service', default => 'Direct Service', }; $serviceHeadRight = match ($type) { 'single_transportation', 'daily_transportation' => 'Direct Transport Service', 'visa' => 'Visa Assistance Service', 'tour_guide', 'tour_reps' => 'Guided Travel Service', default => 'Service Arrangement', }; $issuedDate = now()->format('Y-m-d'); $executiveName = $executive?->name ?? '---'; $executiveId = $executive?->employee_number ?? $executive?->id ?? '---'; $executiveEmail = $executive?->email ?? '---'; $brandParts = preg_split('/\s+/', trim($companyName), 2) ?: ['Azora']; $brandPrimary = $brandParts[0] ?? 'Azora'; $brandSecondary = $brandParts[1] ?? 'Travel'; @endphp {{-- Footer pinned to absolute bottom of PDF page --}}
Please present this voucher and a valid ID at check-in. {{ $companyContact !== '' ? $companyContact : 'Support' }}
{{-- Header --}}
@if ($logoUrl) Logo @else
A
@endif
{{ $brandPrimary }} {{ $brandSecondary }}
{{ $companyTagline }}
Service Voucher
Issued Date: {{ $issuedDate }}
{{-- gap --}}
 
{{-- Customer + Booking cards --}}
P Customer Information
{{-- Primary Guest --}}
Primary Guest
{{ $customerName }}
{{-- Profile Number --}}
Profile / Account Number
{{ $profileNumber }}
{{-- Contact --}}
Contact Details
@if ($customerPhone !== '' || $customerEmail !== '') @if ($customerPhone !== '') {{ $customerPhone }} @endif @if ($customerPhone !== '' && $customerEmail !== '') / @endif @if ($customerEmail !== '') {{ $customerEmail }} @endif @else --- @endif
R Booking Reference
{{-- Service Type --}}
Service Type
{{ $serviceTypeLabel }}
{{-- Status --}}
Voucher Status
{{ $statusLabel }}
{{-- Service Mode --}}
Service Mode
{{ $serviceMode }}
{{-- gap --}}
 
{{-- Service Details --}}
Service Details {{ $serviceHeadRight }}
Service Title
{{ $serviceTitle }}
Date of Service
{{ $serviceDate }}
Number of People
{{ $peopleLabel }}
@if (! empty($invoiceService?->notes))
Notes
{{ $invoiceService->notes }}
@endif
{{-- gap --}}
 
{{-- Assigned Specialist --}}
S Assigned Specialist
{{ $executiveName }}
Employee ID: #{{ $executiveId }}
{{ $executiveEmail }}
Corporate Travel Department {{ $companyName }}