@extends('merchant.templates.layout') @section('head') @endsection @section('content')
Reports Overview
{{-- ============ STAT CARDS ============ --}}
@php $cards = [ ['Total Orders', 'orders', 'ri-shopping-bag-3-line', 'blue'], ['Delivered', 'delivered', 'ri-checkbox-circle-line', 'green'], ['Cancelled', 'cancelled', 'ri-close-circle-line', 'red'], ['Total Quotes', 'quotes', 'ri-file-list-3-line', 'amber'], ['Total Spend', 'total_spend', 'ri-money-dollar-circle-line', 'cyan', true], ['Total Items', 'total_items', 'ri-archive-2-line', 'gray'], ]; @endphp @foreach($cards as $card) @php $label = $card[0]; $key = $card[1]; $icon = $card[2]; $color = $card[3]; $money = $card[4] ?? false; @endphp

{{ $label }}

@if($money) {{ number_format($totals[$key], 2) }} AED @else {{ number_format($totals[$key]) }} @endif

@endforeach
{{-- ============ BREAKDOWN ============ --}}
{{-- Orders per month --}}
Orders — 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 order count
@php $maxC = collect($topCargo)->max('total') ?: 1; @endphp @forelse($topCargo as $tc)
{{ $tc->cargoCompany?->company_name ?: ($tc->cargoCompany?->name ?: '—') }}
{{ $tc->total }}
@empty
No data yet
@endforelse
@endsection