@extends('layouts.app') @section('title', 'Invoice Details') @section('content')
{{-- Header Section --}}
@php $canEditBooking = auth()->user()->roles->pluck('name')->intersect(['Super Admin', 'Co Admin', 'Branch Manager', 'Branch Staff'])->isNotEmpty(); @endphp

Invoice Details

ID: {{ $booking->id }}

Print @if($canEditBooking) @endif
Invoice No

{{ $booking->invoice_id ?? 'N/A' }}

Booking Date

{{ $booking->created_at->format('Y-m-d') }}

Customer

{{ $booking->customer->name ?? 'N/A' }}

Status {{ $booking->invoice && $booking->invoice->balance <= 0 ? 'Paid' : 'Due' }}
Total Value

{{ number_format($booking->invoice?->total_amount ?? 0) }} SAR

Total Paid

{{ number_format($booking->invoice?->paid_amount ?? 0) }} SAR

Due

{{ number_format($booking->invoice?->balance ?? 0) }} SAR

{{-- Passengers Section --}}

Passengers

@forelse($booking->passengers as $index => $passenger) @php $passengerTotal = ($passenger->ticketFare?->fare ?? 0) + ($passenger->package_value ?? 0); @endphp
{{ $passenger->first_name ?? '' }} {{ $passenger->last_name ?? '' }} ({{ $passenger->passport_no ?? 'N/A' }})
{{ number_format($passengerTotal) }} SAR
@empty

No passengers found.

@endforelse
@if($canEditBooking) @endif
{{-- Documents Section --}}

Customer Documents

@forelse($booking->documents as $doc)
{{ $doc->display_name ?? 'Document' }}
@empty

No customer documents

@endforelse

Passenger Documents

@forelse($booking->passengers->flatMap->documents as $doc)
{{ $doc->display_name ?? 'Document' }}
@empty

No passenger documents

@endforelse
{{-- Action Buttons Row --}}
{{-- Tab Navigation --}}
{{-- Payment History Tab --}}

Payment History

@forelse($booking->payments as $payment) @empty @endforelse
Date Voucher No Method Trx ID Amount
{{ $payment->created_at->format('Y-m-d') }} {{ $payment->vouchers->first()?->voucher_id ?? 'N/A' }} {{ $payment->payment_method?->value ?? 'Cash' }} {{ $payment->transaction_id ?? '-' }} {{ number_format($payment->amount) }} SAR
No payments recorded
{{-- Re-issue History Tab --}} {{-- Additional Ticket Tab --}} {{-- Refund Tab --}} {{-- Back Button --}}
@include('partials.passenger-form-modal') {{-- Custom Duration Modal --}}

Set Custom Duration

Enter a value between 30 and 89 days

{{-- Payment Modal --}}

Payment Interface

Booking Summary

Total Package Value: {{ number_format($booking->invoice?->total_amount ?? 0) }} SAR
Paid: {{ number_format($booking->invoice?->paid_amount ?? 0) }} SAR
Due: {{ number_format($booking->invoice?->balance ?? 0) }} SAR
{{-- Request Re-Issue Modal --}} {{-- Re-Issue Details Modal --}} {{-- Request Refund Modal --}} {{-- Refund Details Modal --}} {{-- Request Additional Ticket Modal --}} {{-- Additional Ticket Details Modal --}} {{-- Discount Modal --}} {{-- Toast Container --}}
@push('scripts') @endpush @endsection