@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 ?? 'Company'; $logoUrl = $company && $company->invoice_logo && file_exists(public_path($company->invoice_logo)) ? public_path($company->invoice_logo) : ($company?->logo ?? null); $type = $invoiceService?->travel_tourism_type ?? ''; // Date per service type (format as Y-m-d when possible) $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 ?? ''; } // People count per service type $peopleLabel = ''; if ($invoiceService) { if (in_array($type, ['additional_services', 'daily_transportation', 'single_transportation', 'tour_reps', 'tour_guide'], true)) { $count = (int) ($invoiceService->people_count ?? 0); $peopleLabel = $count > 0 ? $count.' Guests' : ''; } elseif (in_array($type, ['attractions_temples', 'dining_entertainment'], true)) { $adults = (int) ($invoiceService->adults_count ?? 0); $children = (int) ($invoiceService->children_count ?? 0); if ($adults || $children) { $parts = []; if ($adults) { $parts[] = $adults.' Adults'; } if ($children) { $parts[] = $children.' Children'; } $peopleLabel = implode(' - ', $parts); } } elseif ($type === 'visa') { $paxNumber = (int) ($invoiceService->pax_number ?? 0); $peopleLabel = $paxNumber > 0 ? $paxNumber.' Pax' : ''; } } @endphp
@if($logoUrl) Logo @else
@endif
{{ $companyName }}

SERVICE VOUCHER

Issued: {{ now()->format('Y-m-d') }}

Customer Information
Primary Guest
{{ $customerName }}
Profile Number
{{ $profileNumber }}
Contact
{{ trim($customerPhone . ' / ' . $customerEmail, ' /') }}
Booking Reference
Service Type
{{ $invoiceService?->service?->currentTranslation?->title ?? $invoiceService?->service?->title ?? 'Service' }}
Confirmation #
{{ $invoiceService?->reserve_number ?? '' }}
Status
{{ $invoiceService?->status ?? 'Confirmed' }}
Service Details
Service Title
{{ $invoiceService?->service?->currentTranslation?->title ?? $invoiceService?->service?->title ?? 'Service' }}
Date
{{ $serviceDate }}
Number of People
{{ $peopleLabel }}
Description / Notes
{{ $invoiceService?->notes }}
Assigned Specialist
{{ $executive?->name ?? '' }}
@if ($executive)
Employee ID: #{{ $executive->employee_number ?? $executive->id }}
{{ $executive->email }}
@endif

Authorized Signature

Please present this voucher and a valid ID at check-in. {{ $company ? trim(($company->companie_phone ?? '') . ' | ' . ($company->companie_email ?? ''), ' |') : 'Support' }}