{{-- Filters Section --}}

Filters

{{-- KPIs Section --}}

TOTAL ORDERS

{{ number_format($kpis['totalOrders'] ?? 0) }}

REVENUE

${{ number_format($kpis['totalRevenue'] ?? 0, 0) }}

@if(($kpis['revenueGrowth'] ?? 0) != 0)

{{ ($kpis['revenueGrowth'] ?? 0) > 0 ? '↑' : '↓' }} {{ number_format(abs($kpis['revenueGrowth'] ?? 0), 1) }}%

@endif

AVG ORDER

${{ number_format($kpis['avgOrderValue'] ?? 0, 0) }}

RETURNED

{{ number_format($kpis['returnedOrders'] ?? 0) }}

@if($kpis['totalOrders'] > 0)

{{ number_format(($kpis['returnedOrders'] / $kpis['totalOrders']) * 100, 1) }}% rate

@endif

CANCELLED

{{ number_format($kpis['cancelledOrders'] ?? 0) }}

@if($kpis['totalOrders'] > 0)

{{ number_format(($kpis['cancelledOrders'] / $kpis['totalOrders']) * 100, 1) }}% rate

@endif
{{-- Daily Trends Chart - Full Width --}}

Daily Trends

{{-- Analytics Row: Suppliers and Status Distribution --}}
{{-- Supplier Performance --}}

Supplier Performance

@foreach($supplierBreakdown as $supplier)
{{ $supplier->supplier_display }} ${{ number_format($supplier->revenue, 0) }}
Orders: {{ $supplier->order_count }}
Items: {{ $supplier->item_count }}
Fulfillment {{ number_format($supplier->fulfillment_rate, 0) }}%
@endforeach
{{-- Status Distribution --}}

Status Distribution

@php $totalStatusCount = collect($statusBreakdown)->sum('count'); @endphp @foreach(array_slice($statusBreakdown, 0, 8) as $status) @php $percentage = $totalStatusCount > 0 ? ($status->count / $totalStatusCount) * 100 : 0; @endphp
{{ $status->status }}
{{ $status->count }} ({{ number_format($percentage, 0) }}%)
@endforeach
{{-- Top Products Section --}}

Top Products

@foreach(array_slice($topProducts, 0, 9) as $index => $product)
{{ $index + 1 }}
{{ $product->part_num }}
{{ Str::limit($product->name, 25) }}
@if($topProductsSort === 'units')
{{ number_format($product->total_quantity) }} qty
${{ number_format($product->revenue, 0) }}
@else
${{ number_format($product->revenue, 0) }}
{{ number_format($product->total_quantity) }} qty
@endif
@endforeach
{{-- Orders Table --}}

Orders

@foreach($orders as $order) @endforeach
Suppliers Tracking
#{{ $order->external_order_id ?: $order->order_id }} {{ Carbon\Carbon::parse($order->date_placed)->format('M d, Y') }}
{{ $order->customer_name }}
{{ $order->customer_email }}
{{ $order->suppliers }} {{ $order->item_count }} ({{ $order->total_quantity }}) ${{ number_format($order->order_total, 2) }} {{ $order->order_status }} @if($order->tracked_items > 0) ✓ {{ $order->tracked_items }} @else - @endif
{{-- Pagination --}} @if($ordersPagination && $ordersPagination['last_page'] > 1)
Showing {{ (($ordersPagination['current_page'] - 1) * $ordersPagination['per_page']) + 1 }} to {{ min($ordersPagination['current_page'] * $ordersPagination['per_page'], $ordersPagination['total']) }} of {{ $ordersPagination['total'] }} results
@for($i = max(1, $ordersPagination['current_page'] - 2); $i <= min($ordersPagination['last_page'], $ordersPagination['current_page'] + 2); $i++) @endfor
@endif