@extends('transporter.templates.layout') @section('head') @endsection @section('content')
Reports Overview
{{-- ============ STAT CARDS ============ --}}
@php $cards = [ ['Total Deliveries', 'total', 'ri-truck-line', 'blue'], ['Active', 'active', 'ri-loader-4-line', 'amber'], ['Completed', 'completed', 'ri-checkbox-circle-line', 'green'], ['Rejected', 'rejected', 'ri-close-circle-line', 'red'], ]; @endphp @foreach($cards as [$label, $key, $icon, $color])

{{ $label }}

{{ number_format($totals[$key]) }}

@endforeach {{-- Total Charges (matches API `total_transporter_charge`) --}}

Total Transport Charges

{{ number_format($totals['total_charges'], 2) }} AED

{{-- Completed earnings --}}

Completed Earnings

{{ number_format($totals['completed_earnings'], 2) }} AED

Total Items Handled

{{ number_format($totals['items']) }}

{{-- ============ BREAKDOWN ============ --}}
{{-- Deliveries per month --}}
Deliveries — Last 6 Months
Monthly totals
@php $max = collect($monthly)->max('total') ?: 1; @endphp @forelse($monthly as $m)
{{ $m->month }}
{{ $m->total }}
@empty
No data yet
@endforelse
{{-- Top cargo companies --}}
Top Cargo Companies
By deliveries
@php $maxC = collect($topCargo)->max('total') ?: 1; @endphp @forelse($topCargo as $tc)
{{ $tc->name }}
{{ $tc->total }}
@empty
No data yet
@endforelse
@endsection