@extends('backend.template.layouts.template-base') @section('title', $pageTitle . ' | ' . config('app.name')) @section('styles') @endsection @section('content') @php $activeStatus = $filters['status'] ?? 'all'; $activeView = $filters['view'] ?? 'grid'; $currentRoute = match ($mode) { 'overview' => 'backend.template.packing.categories', 'packed' => 'backend.template.packing.packed', 'history' => 'backend.template.packing.history', default => 'backend.template.packing.index', }; $query = $mode === 'overview' ? fn (array $extra = []) => array_filter(array_merge([ 'range' => $filters['range'] ?? 'today', 'from' => $filters['from'] ?? null, 'to' => $filters['to'] ?? null, 'category' => $filters['category'] ?? null, 'pack_size' => $filters['pack_size'] ?? null, 'group' => $filters['group'] ?? 'category', 'view' => $activeView, ], $extra), fn ($value) => $value !== null && $value !== '') : fn (array $extra = []) => array_filter(array_merge([ 'date' => $filters['date'] ?? null, 'q' => $filters['q'] ?? null, 'status' => $mode === 'queue' ? $activeStatus : null, 'view' => $activeView, ], $extra), fn ($value) => $value !== null && $value !== ''); $moduleTabs = [ ['label' => 'Packing Queue', 'icon' => 'ri-inbox-archive-line', 'route' => 'backend.template.packing.index', 'active' => $mode === 'queue'], ['label' => 'Packing Categories', 'icon' => 'ri-dashboard-3-line', 'route' => 'backend.template.packing.categories', 'active' => $mode === 'overview'], ['label' => 'Packed Orders', 'icon' => 'ri-checkbox-circle-line', 'route' => 'backend.template.packing.packed', 'active' => $mode === 'packed'], ['label' => 'Packing History', 'icon' => 'ri-history-line', 'route' => 'backend.template.packing.history', 'active' => $mode === 'history'], ]; $imageUrl = fn ($path) => $path ? (preg_match('/^https?:\/\//i', (string) $path) ? $path : asset($path)) : null; @endphp

{{ $pageTitle }}

{{ $pageSubtitle }}

@if ($mode !== 'overview') Print Packing Slip @endif
@if (session('message'))
{{ session('message') }}
@endif @if ($mode === 'overview') @php $rangeTabs = [ 'today' => 'Today', 'tomorrow' => 'Tomorrow', 'last_7_days' => 'Last 7 Days', 'custom' => 'Custom Range', ]; $activeGroup = $filters['group'] ?? 'category'; $overviewCards = $activeGroup === 'pack_size' ? $overview['pack_size_cards'] : $overview['category_cards']; @endphp
@foreach ($rangeTabs as $key => $label) {{ $label }} @if ($key === 'custom') @endif @endforeach
@if (($filters['range'] ?? '') === 'custom') @endif
@foreach ($overview['kpis'] as $kpi)

{{ $kpi['label'] }}

{{ $kpi['value'] }}

{{ $kpi['note'] }}

@endforeach

Packing Progress by Category & Pack Size

@if ($overviewCards->isEmpty())
No packing overview found

Try another range, category, or pack size.

@else
@foreach ($overviewCards as $card)
@if ($card['image']) {{ $card['title'] }} @else @endif

{{ $card['title'] }}

{{ $card['subtitle'] }} {{ $card['badge']['label'] }}

{{ $card['efficiency'] }}% Efficiency
Qty: {{ $card['target_units_display'] }} Packed: {{ $card['packed_display'] }} Pending: {{ $card['pending_display'] }} Target: {{ $card['target_display'] }}
@foreach ($card['rows'] as $row) @endforeach
{{ $card['row_heading'] }} Qty Total To Pack Packed Pending Progress
{{ $row['label'] }} {{ $row['target_units_display'] }} {{ $row['target_display'] }} {{ $row['packed_display'] }} {{ $row['pending_display'] }} {{ $row['completion'] }}%
@if ($card['pending'] > 0)
{{ $card['pending_display'] }} / {{ $card['pending_units_display'] }} qty pending to complete
@endif
@endforeach
@endif

Pack Size Summary (All Categories)

@forelse ($overview['summary_rows'] as $row) @empty @endforelse
Pack Size Total Qty Packed Qty Pending Qty Total To Pack Packed Pending Completion Progress
{{ $row['label'] }} {{ $row['target_units_display'] }} {{ $row['packed_units_display'] }} {{ $row['pending_units_display'] }} {{ $row['target_display'] }} {{ $row['packed_display'] }} {{ $row['pending_display'] }} {{ $row['completion'] }}%
No pack size data found.
{{ $overview['totals']['target_display'] }} Total Target
Packed ({{ $overview['totals']['packed_display'] }}) Pending ({{ $overview['totals']['pending_display'] }}) Qty {{ $overview['totals']['packed_units_display'] }} / {{ $overview['totals']['target_units_display'] }}
@else
@if ($mode === 'queue') @else @endif
@if ($mode === 'queue') @endif Today
@if ($orders->isEmpty())
No packing orders found

Try another delivery date, search term, or queue status.

@else
@foreach ($orders as $order)

{{ $order['order_no'] }} @if (!empty($order['is_vital_kitchen'])) Vital Kitchen @endif

{{ $order['badge']['label'] }}
{{ $order['time_state']['label'] }}
{{ $order['slot']['date'] }} • {{ $order['slot']['time'] }}
{{ $order['customer'] }}
{{ number_format($order['items_count']) }} Items
    @foreach ($order['items'] as $item)
  • {{ $item['name'] }} {{ $item['quantity'] }}
  • @endforeach
@if ($order['more_count'] > 0) + {{ number_format($order['more_count']) }} more item{{ $order['more_count'] === 1 ? '' : 's' }} @endif
@if ($order['can_pack'])
@csrf @method('PATCH')
@else {{ $order['done_label'] ?? 'Packed' }} @endif
@endforeach
@endif @endif
@endsection