@php use App\Enums\OrderStatus; $orderSound = asset('sounds/notify.mp3'); @endphp
@if ($editingOrderId)

{{ __('dashboard.edit_order') }} #{{ $editingOrderId }}

@endif

{{ __('dashboard.active_orders') }}

{{ $stats['active'] }}

{{ __('dashboard.pending') }}

{{ $stats['pending'] }}

{{ __('dashboard.completed_today') }}

{{ $stats['completed_today'] }}

{{ __('dashboard.revenue') }}

{{ currency($stats['revenue_today']) }}

@php $tabs = [ ['id' => 'all', 'label' => __('All'), 'icon' => 'M4 6h16M4 10h16M4 14h16M4 18h16'], [ 'id' => 'pending', 'label' => __('Pending'), 'icon' => 'M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z', ], [ 'id' => 'processing', 'label' => __('Kitchen'), 'icon' => 'M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C13 5 16.08 5.54 17.657 8.343a8 8 0 010 10.314z', ], [ 'id' => 'ready', 'label' => __('Ready'), 'icon' => 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z', ], ['id' => 'delivery', 'label' => __('Service'), 'icon' => 'M13 10V3L4 14h7v7l9-11h-7z'], ['id' => 'completed', 'label' => __('History'), 'icon' => 'M5 13l4 4L19 7'], ]; @endphp
@foreach ($tabs as $tab) @endforeach
@can('create', $this->getModelClass()) {{ __('dashboard.new_order') }} @endcan
@if (($filters['date_preset'] ?? '') === 'custom' || empty($filters['date_preset'] ?? ''))
-
@endif
@if ($rows->isEmpty())

{{ __('dashboard.no_orders_found') }}

{{ __('Try adjusting your filters or active tab to find what you are looking for.') }}

@else
@foreach ($rows as $order)
{{--
--}} @php $allowedParams = \App\Enums\OrderStatus::allowedForType($order->type); $currentIdx = array_search($order->status, $allowedParams); $totalSteps = count($allowedParams); $progress = $totalSteps > 1 ? ($currentIdx / ($totalSteps - 1)) * 100 : 0; if ($order->status === \App\Enums\OrderStatus::Completed) { $progress = 100; } $nextStatus = $allowedParams[$currentIdx + 1] ?? null; if ($nextStatus === \App\Enums\OrderStatus::Cancelled) { $nextStatus = $allowedParams[$currentIdx + 2] ?? null; } @endphp

#{{ $order->id }}

{{ $order->type->label() }} @if ($order->table) {{ $order->table->name }} @endif
{{ $order->status->label() }}
@foreach ($order->items->take(2) as $item)
{{ $item->qty }} {{ $item->name }}
{{ currency($item->line_total) }}
@endforeach @if ($order->items->count() > 2)

+ {{ $order->items->count() - 2 }} {{ __('dashboard.more_items') }}

@endif
@if ($order->deliveryAgent)
{{ $order->deliveryAgent->initials() }}
{{ __('dashboard.driver') }} {{ $order->deliveryAgent->name }}
@endif
{{ __('dashboard.total') }} {{ currency($order->total) }}
@if ($nextStatus) @else
{{ __('Completed') }}
@endif
@endforeach
{{ $rows->links() }}
@endif

{{ __('Update Status for') }} {{ count($selectedRecords) }} {{ __('Orders') }}

@foreach ($statuses as $status) @endforeach @error('bulkTargetStatus') {{ $message }} @enderror