@php
$companyKeys = [
'company_name_en',
'company_address_en',
'tax_number',
'commercial_register',
'tourism_license',
];
$company = \App\Models\Setting::whereIn('key', $companyKeys)->pluck('value', 'key');
@endphp
@if(($invoice->type ?? null) === 'refund')
فاتورة استرجاع / REFUND INVOICE
@endif
Company Details
| Company Name |
{{ $company['company_name_en'] ?? '' }} |
Address |
{{ $company['company_address_en'] ?? '' }} |
| Tax Number |
{{ $company['tax_number'] ?? '' }} |
Commercial Register |
{{ $company['commercial_register'] ?? '' }} |
| Tourism License |
{{ $company['tourism_license'] ?? '' }} |
Client Details
@php
$ticket = $invoice->tickets->first();
$client = $ticket->client
?? $ticket->supplier
?? $ticket->branch
?? $ticket->franchise;
@endphp
| Client Name |
{{ $client->company_name ?? $client->name ?? ''}} |
Address |
{{ $client->address ?? '' }} |
| Tax Number |
{{ $client->tax_number ?? '' }} |
@foreach($invoice->tickets as $ticket)
@if(!$loop->first)
@endif
Ticket Details
| Airline Name |
{{ $ticket->airline->name ?? $ticket->airline_name }} ({{ $ticket->airline->iata_code ?? '' }}) |
Airline Code |
{{ $ticket->airline->iata_prefix ?? $ticket->validating_carrier_code ?? '' }} |
| Ticket Number |
{{ $ticket->ticket_number_full ?? '' }} |
Issue Date |
{{ $ticket->issue_date ? $ticket->issue_date->format('Y-m-d') : '' }} |
| Itinerary |
@if($ticket->segments->count() > 0)
{{ $ticket->segments->pluck('origin.iata')->join(' → ') }}
→
{{ $ticket->segments->last()->destination->iata }}
@else
{{ $ticket->itinerary_string ?? 'N/A' }}
@endif
|
| Beneficiary |
{{ $ticket->client->name ?? 'N/A' }} |
PNR |
{{ $ticket->pnr ?? '' }} |
@if($ticket->segments->count() > 0)
@foreach($ticket->segments as $segment)
Flight Details
| Flight Number |
{{ $segment->flight_number ?? '' }} |
Ticket Number |
{{ $ticket->ticket_number_core ?? '' }} |
| From |
{{ $segment->origin->city ?? $segment->origin->iata ?? '' }} |
To |
{{ $segment->destination->city ?? $segment->destination->iata ?? '' }} |
| Departure Date |
{{ $segment->departure_at ? $segment->departure_at->format('Y-m-d') : '' }} |
Departure Time |
{{ $segment->departure_at ? $segment->departure_at->format('H:i') : '' }} |
| Arrival Date |
{{ $segment->arrival_at ? $segment->arrival_at->format('Y-m-d') : '' }} |
Arrival Time |
{{ $segment->arrival_at ? $segment->arrival_at->format('H:i') : '' }} |
| Flight Number |
{{ $segment->flight_number ?? '' }} |
@endforeach
@endif
Passenger Details
@if($ticket->passengers->count() > 0)
@foreach($ticket->passengers as $passenger)
| Passenger Name |
{{ strtoupper(trim(($passenger->first_name ?? '') . ' ' . ($passenger->last_name ?? ''))) }} |
Nationality |
{{ $passenger->nationality ?? '' }} |
| Passport Number |
{{ $passenger->passport_number ?? '' }} |
Passport Expiry |
{{ $passenger->passport_expiry_date ?? '' }} |
| Date of Birth |
{{ $passenger->date_of_birth ?? '' }} |
Phone |
{{ $passenger->phone ?? '' }} |
@endforeach
@endif
Price Details
| Base Price |
{{ number_format($ticket->cost_base_amount ?? 0, 0) }} {{ $ticket->currency->symbol ?? 'SAR' }} |
Taxes |
{{ number_format(($ticket->cost_tax_amount ?? 0) + ($ticket->extra_tax_amount ?? 0), 0) }} {{ $ticket->currency->symbol ?? 'SAR' }} |
Total Price |
{{ number_format($ticket->sale_total_amount ?? 0, 2) }} {{ $ticket->currency->symbol ?? 'SAR' }} |
Baggage & Restrictions
| Baggage Allowance |
N/A |
| Restrictions |
N/A |
Other Information
| Booking Date |
{{ $ticket->booking_date ? $ticket->booking_date->format('Y-m-d') : ($ticket->issue_date ? $ticket->issue_date->format('Y-m-d') : '') }} |
Payment Method |
CASH |
Supplier |
{{ $ticket->supplier->name ?? 'N/A' }} |
@endforeach
Invoice Details
| Invoice Number |
{{ $invoice->invoice_number ?? '' }} |
Invoice Date |
{{ $invoice->created_at ? $invoice->created_at->format('Y-m-d') : '' }} |
Due Date |
{{ $invoice->due_date ? $invoice->due_date/*->format('Y-m-d')*/ : '' }} |
| Total Taxes |
{{ number_format($invoice->total_taxes ?? 0, 2) }} |
Total Amount |
{{ number_format($invoice->total_amount ?? 0, 2) }} |