Invoice {{-- Dynamic print-hide style (updated by JS) --}}
{{-- ================ FILTER CARD ================ --}}
Clear
@if($trips->isNotEmpty()) {{-- ============ ACTION BUTTONS ============ --}}
{{-- ============ INVOICE PRINTABLE ============ --}}
{{-- ── Invoice Header ── --}}
{{-- Vehicle Number --}}

{{ $selectedVehicle ? $selectedVehicle->vehicle_number : 'All Vehicles' }}

{{-- Location --}} @php $invoiceLocation = request('location') ?: ($trips->first()?->location ?? null); @endphp @if($invoiceLocation)
{{ $invoiceLocation }}
@endif {{-- Date --}}

{{ now()->format('d M Y') }}

{{-- ── Data Table ── --}}
{{-- Checkbox row: controls print/pdf columns only (screen always shows all) --}} {{-- Column header row --}} @foreach($trips as $i => $trip) @endforeach {{-- Spacer row: one line gap before summary --}}
S.No Date Open Hr Close Hr Total Hr Diesel (Ltr) Diesel Price (₹) Rent Amount (₹)
{{ $i + 1 }} {{ $trip->date ? $trip->date->format('d M Y') : '—' }} {{ $trip->open_hour ?? '—' }} {{ $trip->close_hour ?? '—' }} {{ number_format((float)($trip->total_hour ?? 0), 2) }} {{ number_format((float)($trip->fuel_litre ?? 0), 2) }} ₹{{ number_format((float)($trip->fuel_cost ?? 0), 2) }} ₹{{ number_format((float)($trip->total_amount ?? 0), 2) }}
{{-- ── Invoice Summary ── --}}
{{-- Always shown --}} {{-- Only when col 4 (Total Hr) is checked --}} {{-- Only when col 5 (Diesel Ltr) is checked --}} {{-- Only when col 6 (Diesel Price) is checked --}} {{-- Only when col 7 (Rent Amount) is checked --}}
Total Trips {{ $trips->count() }}
Total Hours {{ number_format($trips->sum('total_hour'), 2) }} hr
Diesel Used {{ number_format($totalDieselLtr, 2) }} ltr
Overall Diesel Price ₹{{ number_format($totalOverallDiesel, 2) }}
Total Rent Amount ₹{{ number_format($totalRentAmount, 2) }}
@else

No invoice data found

Apply filters above and click Generate to build your invoice.

@endif