@extends('layout.app') @section('title', 'Fleet & Operations Dashboard') @push('header_script') @endpush @section('content')
New Trip Sheet Freight Entry
@if(is_desktop_mode()) DESKTOP EDITION Licensed Limit: {{ $vehicleLimit }} Vehicles Upgrade Limit @if($desktopLicense && !empty($desktopLicense['expiryDate'])) Valid till: {{ date('d-M-Y', strtotime($desktopLicense['expiryDate'])) }} @else Lifetime Validity @endif @else {{ $currentTenant ? $currentTenant->company_code : 'CLIENT' }} @if($currentTenant && $currentTenant->plan) {{ $currentTenant->plan->name }} ({{ $currentTenant->plan->billing_cycle }}) @elseif($currentTenant && $currentTenant->subscription_plan) {{ $currentTenant->subscription_plan }} @endif @if($currentTenant && $currentTenant->plan_expires_at) Valid till: {{ $currentTenant->plan_expires_at->format('d-M-Y') }} @endif @endif

{{ $currentTenant ? $currentTenant->company_name : 'Welcome to Fleet ERP' }}

Fleet Utilization

{{ $totalVehicles }} / {{ $vehicleLimit }} Limit

@php $utilPercent = $vehicleLimit > 0 ? min(100, round(($totalVehicles / $vehicleLimit) * 100)) : 0; @endphp
{{ $assignedVehicles }} Assigned / On Trip {{ $availableVehicles }} Available
Active Operations

{{ $totalTrips }} Trips

{{ $activeTrips }} In Transit {{ $completedTrips }} Completed {{ $totalFreightEntries }} GRs
Freight Revenue (Month)

₹{{ number_format($monthRevenue, 2) }}

Lifetime Billed: ₹{{ number_format($totalRevenue, 2) }}
Operating Expenses

₹{{ number_format($monthExpenses, 2) }}

Active Drivers: {{ $totalDrivers }} Staff: {{ $totalStaff }}
Operational Performance (Last 6 Months)
Freight Revenue vs Operating & Trip Expenses
Revenue / Expenses
Fleet Status Breakdown
Current vehicle allocation overview
  Assigned / On Duty {{ $assignedVehicles }}
  Available / Idle {{ $availableVehicles }}
Recent Trips & Dispatches
View All Trips
@forelse($recentTrips as $trip) @empty @endforelse
Trip # Vehicle Route Driver Freight (₹) Status
#{{ $trip->trip_sheet_no ?: $trip->id }} {{ $trip->vehicle ? $trip->vehicle->vehicle_no : 'N/A' }} {{ $trip->from_location ?: 'Origin' }} {{ $trip->to_location ?: 'Destination' }} {{ $trip->driver_name ?: 'Assigned' }} ₹{{ number_format($trip->freight_amount ?: 0, 2) }} @php $status = $trip->status ?: 'Active'; $sBadge = 'bg-secondary'; if (in_array($status, ['Active', 'Running', 'In Transit'])) $sBadge = 'bg-success'; elseif (in_array($status, ['Completed', 'Closed'])) $sBadge = 'bg-info text-dark'; elseif ($status == 'Cancelled') $sBadge = 'bg-danger'; @endphp {{ $status }}
No trips logged yet. Click New Trip Sheet to start dispatching.
Compliance & Expiry Watchlist
Next 30 Days
@forelse($expiringDocuments as $doc)
{{ $doc['vehicle_no'] }}
{{ $doc['doc_type'] }} • Valid till: {{ $doc['expiry_date'] }}
@if($doc['days_left'] < 0) Expired ({{ abs($doc['days_left']) }}d ago) @elseif($doc['days_left'] <= 7) {{ $doc['days_left'] }} day(s) left @else {{ $doc['days_left'] }} days left @endif
@empty
All Vehicle Documents Healthy!

No vehicle insurance, fitness, permit, or tax expiring within 30 days.

@endforelse
@endsection @push('footer_script') @endpush