@extends('admin.templates.layout') @section('head') @endsection @section('content')

Reports & Analytics

Operational snapshot across orders, merchants, cargo, and transporters.

Summary
{{ \Carbon\Carbon::parse($from)->format('M d, Y') }} — {{ \Carbon\Carbon::parse($to)->format('M d, Y') }}
@php $summaryCards = [ ['Total Orders', 'total_orders', 'ri-shopping-bag-3-line', 'blue', $summary['total_orders']], ['Completed', 'completed_orders', 'ri-checkbox-circle-line', 'green', $summary['completed_orders']], ['Cancelled', 'cancelled_orders', 'ri-close-circle-line', 'red', $summary['cancelled_orders']], ['In Transit', 'in_transit', 'ri-truck-line', 'amber', $summary['in_transit']], ['Total SKUs', 'total_products', 'ri-qr-code-line', 'cyan', $summary['total_products']], ['Invoices', 'total_invoices', 'ri-file-list-3-line', 'gray', $summary['total_invoices'] ?? 0], ]; @endphp @foreach($summaryCards as [$label, $key, $icon, $color, $value])
{{ $label }}
{{ number_format($value) }}
@endforeach
Top Performers
Top Merchants

By orders created in the period

    @forelse($topMerchants as $i => $m)
  • {{ $i + 1 }}
    {{ $m->company_name ?: $m->name }}
    {{ $m->orders_count }}
  • @empty
  • No merchant activity
  • @endforelse
Top Cargo Companies

By orders handled in the period

    @forelse($topCargo as $i => $c)
  • {{ $i + 1 }}
    {{ $c->company_name ?: $c->name }}
    {{ $c->orders_count }}
  • @empty
  • No cargo activity
  • @endforelse
Top Transporters

By deliveries in the period

    @forelse($topTransporters as $i => $t)
  • {{ $i + 1 }}
    {{ $t->company_name ?: $t->name }}
    {{ $t->deliveries_count }}
  • @empty
  • No transporter activity
  • @endforelse
Order Status Breakdown
Status Distribution

Total orders in each lifecycle stage

@php $colorMap = [ 'warning' => '#f59e0b', 'info' => '#06b6d4', 'primary' => '#3b82f6', 'success' => '#10b981', 'danger' => '#ef4444', 'secondary' => '#64748b', ]; @endphp @foreach($statusBreakdown as $status => $info)
{{ $info['text'] }} {{ $info['total'] }}
@endforeach
Operational Insights

Quick highlights for the selected period

@php $totalOrders = max(1, $summary['total_orders']); $completionRate = round(($summary['completed_orders'] / $totalOrders) * 100); $cancelRate = round(($summary['cancelled_orders'] / $totalOrders) * 100); $transitRate = round(($summary['in_transit'] / $totalOrders) * 100); @endphp
Completion Rate {{ $completionRate }}%
In Transit Rate {{ $transitRate }}%
Cancellation Rate {{ $cancelRate }}%

Avg. Orders / Day
@php $days = max(1, \Carbon\Carbon::parse($from)->diffInDays(\Carbon\Carbon::parse($to)) + 1); echo round($summary['total_orders'] / $days, 1); @endphp
Active Period
{{ $days }} {{ \Illuminate\Support\Str::plural('day', $days) }}
@endsection