@extends('pdf.reports.base') @section('content')
| # | Vehicle Reg. No. | Category & Type | Assigned Operators | Days Run | Shifts | Total Distance | Run Hours | Status |
|---|---|---|---|---|---|---|---|---|
| {{ $index + 1 }} | {{ $row['vehicle_number'] }} | {{ $row['category_name'] }} | {{ $row['drivers'] ?: 'Unassigned / Float' }} | {{ $row['operating_days'] }} Days | {{ $row['shifts_worked'] }} | {{ number_format((float) $row['total_distance_km'], 3) }} KM | {{ $row['formatted_duration'] }} | @if($row['status'] === 'active') Active @elseif($row['status'] === 'maintenance') Service @else {{ ucfirst($row['status']) }} @endif |
| No vehicle records found matching the selected parameters. | ||||||||
| CONSOLIDATED FLEET TOTALS ({{ $grandTotals['total_vehicles'] ?? 0 }} VEHICLES): | {{ $grandTotals['unique_drivers_count'] ?? 0 }} Drivers Active | {{ $grandTotals['unique_dates_count'] ?? 0 }} Days | {{ $grandTotals['total_tours'] ?? 0 }} Shifts | {{ number_format((float) ($grandTotals['total_distance_km'] ?? 0), 3) }} KM | {{ $grandTotals['formatted_duration'] ?? '0h 00m' }} | ALL UNITS | ||
| Duty / Tour Ref | Date | Driver / Operator | Assigned Route | Shift Timing | Start | End | Duration | Distance | Status |
|---|---|---|---|---|---|---|---|---|---|
| {{ $tour->driverDuty?->duty_code ?? ('#TOUR-' . str_pad((string) $tour->id, 5, '0', STR_PAD_LEFT)) }} | {{ $tour->start_time ? $tour->start_time->format('d M Y') : 'N/A' }} | {{ $tour->employee?->full_name ?? ($tour->user?->name ?? 'Unassigned') }} | {{ $tour->route?->name ?? ($tour->driverDuty?->route?->name ?? 'Municipal Sector Route') }} |
@php
$shiftHelper = app(\App\Services\ConsolidatedReportService::class);
$sInfo = $shiftHelper->resolveShiftInfo($tour);
@endphp
{{ $sInfo['name'] }}
{{ $sInfo['window'] }}
|
{{ $tour->start_time ? $tour->start_time->format('H:i') : '--:--' }} | {{ $tour->end_time ? $tour->end_time->format('H:i') : 'Active' }} | {{ $tour->formatted_duration }} | {{ number_format((float) $tour->total_distance_km, 3) }} KM | @if($tour->status === 'completed') Done @elseif($tour->status === 'in_progress') Active @else {{ ucfirst($tour->status) }} @endif |
| SUBTOTAL FOR {{ $group['vehicle_number'] }} ({{ $group['tours_count'] }} SHIFTS): | {{ $group['operating_days_count'] }} Days Run | {{ $group['formatted_duration'] }} | {{ number_format((float) $group['total_distance_km'], 3) }} KM | OK | |||||