@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); } $brandParts = preg_split('/\s+/', trim($companyName), 2) ?: ['Azora']; $brandPrimary = $brandParts[0] ?? 'Azora'; $brandSecondary = $brandParts[1] ?? 'Travel'; $pnr = $invoiceService?->pnr_number ?: '---'; $officeId = $invoiceService?->office_id ?: '---'; $ticketDate = '---'; if ($invoiceService?->ticket_date) { try { $ticketDate = \Carbon\Carbon::parse($invoiceService->ticket_date)->format('Y-m-d'); } catch (\Throwable $e) { $ticketDate = (string) $invoiceService->ticket_date; } } $directionType = $invoiceService?->direction_type ?? ''; $serviceTypeLabel = $directionType !== '' ? str_replace('_', ' ', ucfirst($directionType)) : 'Flight'; $segments = $invoiceService?->segments ?? collect(); $paxs = $invoiceService?->paxs ?? collect(); $firstSegment = $segments->first(); $firstPax = $paxs->first(); $passportNumber = $firstPax?->passport_number ?? $customer?->passport ?? $customer?->passport_number ?? '---'; $peopleCount = $paxs->isNotEmpty() ? $paxs->count() : 1; $peopleLabel = $peopleCount.' '.($peopleCount === 1 ? 'Guest' : 'Guests'); $serviceTitle = $invoiceService?->service?->currentTranslation?->title ?? $invoiceService?->service?->title ?? ($firstSegment ? trim(($firstSegment->flightCompany?->code ?? $firstSegment->flightCompany?->name ?? '').' '.($firstSegment->flight_number ?? '')) : 'Flight Service'); if ($serviceTitle === '') { $serviceTitle = 'Flight Service'; } $serviceDate = '---'; if ($firstSegment?->date) { try { $serviceDate = \Carbon\Carbon::parse($firstSegment->date)->format('Y-m-d'); } catch (\Throwable $e) { $serviceDate = (string) $firstSegment->date; } } elseif ($ticketDate !== '---') { $serviceDate = $ticketDate; } $rawStatus = strtolower((string) ($invoiceService?->status ?? 'pending')); $statusMap = [ 'pending' => 'Pending Confirmation', 'draft' => 'Draft', 'confirmed' => 'Confirmed', 'done' => 'Completed', 'issued' => 'Issued', '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', 'issued'], true) => '#DCFCE7', in_array($rawStatus, ['cancelled', 'refund', 'no_show'], true) => '#FEE2E2', default => '#FEF3C7', }; $statusColor = match (true) { in_array($rawStatus, ['confirmed', 'done', 'issued'], 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 ?? '---'; $domainAgency = $invoiceService?->domain?->currentTranslation?->name ?? $invoiceService?->domain?->name ?? $companyName; @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 }}
Flight Voucher
Issued Date: {{ $issuedDate }}
 
{{-- Customer + Booking cards --}}
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
PNR (Reference)
{{ $pnr }}
Passport Number
{{ $passportNumber ?: '---' }}
R Booking Reference
Ticket Date
{{ $ticketDate }}
Domain / Agency
{{ $domainAgency }}
Office ID
{{ $officeId }}
Service Type
{{ $serviceTypeLabel }}
Voucher Status
{{ $statusLabel }}
 
{{-- Service Details --}}
Service Details Direct Transport Service
Service Title
{{ $serviceTitle }}
Date of Service
{{ $serviceDate }}
Number of People
{{ $peopleLabel }}
@if ($segments->isNotEmpty()) @foreach ($segments->take(2) as $seg) @php $originCode = $seg->originAirport?->code ?? '---'; $originName = $seg->originAirport?->name ?? $seg->originAirport?->currentTranslation?->name ?? ''; $destCode = $seg->destinationAirport?->code ?? '---'; $destName = $seg->destinationAirport?->name ?? $seg->destinationAirport?->currentTranslation?->name ?? ''; $segDate = '---'; if ($seg->date) { try { $segDate = \Carbon\Carbon::parse($seg->date)->format('Y-m-d'); } catch (\Throwable $e) { $segDate = (string) $seg->date; } } $segTime = $seg->time ?: '---'; $flightNum = trim(($seg->flightCompany?->code ?? $seg->flightCompany?->name ?? '').' '.($seg->flight_number ?? '')); if ($flightNum === '') { $flightNum = '---'; } @endphp {{-- Labels on one line --}} {{-- Values on one straight line --}} {{-- Airport names under origin/destination only --}}
Origin Destination Flight Date Departure Time Flight Number
{{ $originCode }} {{ $destCode }} {{ $segDate }} {{ $segTime }} {{ $flightNum }}
{{ $originName !== '' ? $originName : '' }} {{ $destName !== '' ? $destName : '' }}
@endforeach @else
No flight segments available
@endif
 
{{-- Assigned Specialist --}}
S Assigned Specialist
{{ $executiveName }}
Employee ID: #{{ $executiveId }}
{{ $executiveEmail }}
Corporate Travel Department {{ $companyName }}