@extends('pdf.layouts.app') @section('title', 'Airline Tickets Report') @section('styles') @endsection @section('content')
@php $tickets = $tickets ?? collect(); $summary = $summary ?? []; @endphp @if($tickets->count() > 0)
{{ __('Period') }}: {{ $origin_date ?? '-' }} {{ $destination_date ? ' - ' . $destination_date : '' }}
@foreach($tickets as $index => $ticket) @php $invoiceService = $ticket->invoiceService; $profile = $invoiceService?->profile; $profileType = $profile?->type; $service = $invoiceService?->service; $fare = (float) ($ticket->fare_price ?? 0); $tax = (float) ($ticket->tax ?? 0); $earned = (float) ($ticket->earned_discount ?? 0); $granted = (float) ($ticket->granted_discount ?? 0); $total = (float) ($ticket->total_price ?? 0); @endphp @endforeach
# {{ __('Issue Date') }} {{ __('PNR') }} {{ __('Ticket Number') }} {{ __('Passenger') }} {{ __('Direction') }} {{ __('From Airport') }} {{ __('To Airport') }} {{ __('Flight Company') }} {{ __('Class') }} {{ __('Profile Number') }} {{ __('Profile Type') }} {{ __('Service') }} {{ __('Fare') }} {{ __('Tax') }} {{ __('Earned Discount') }} {{ __('Granted Discount') }} {{ __('Total') }}
{{ $index + 1 }} {{ optional($ticket->issue_date)->format('Y-m-d') }} {{ $ticket->pnr }} {{ $ticket->ticket_num }} {{ $ticket->passenger_name }} {{ $ticket->go_back }} {{ $ticket->fromAirport->name ?? $ticket->fromAirport->code ?? '' }} {{ $ticket->toAirport->name ?? $ticket->toAirport->code ?? '' }} {{ $ticket->fromAirline->name ?? $ticket->toAirline->name ?? '' }} {{ $ticket->economy_class }} {{ $profile->profile_number ?? '' }} {{ $profileType?->currentTranslation->name ?? $profileType?->name ?? '' }} {{ $service?->currentTranslation->title ?? $service?->title ?? '' }} {{ number_format($fare, 2) }} {{ number_format($tax, 2) }} {{ number_format($earned, 2) }} {{ number_format($granted, 2) }} {{ number_format($total, 2) }}
{{ __('Totals') }} {{ number_format($summary['fare_price'] ?? 0, 2) }} {{ number_format($summary['tax'] ?? 0, 2) }} {{ number_format($summary['earned_discount'] ?? 0, 2) }} {{ number_format($summary['granted_discount'] ?? 0, 2) }} {{ number_format($summary['total_price'] ?? 0, 2) }}
@else

{{ __('No data available for this report.') }}

@endif
@endsection