@php use App\Enums\OrderStatus; @endphp
@error('conflict')

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

{{ $message }}
@enderror @unless($isSlideOver)

{{ __('dashboard.order') }} #{{ $form->model->id }}

{{ $form->model->created_at->format('d M Y, h:i A') }} @php $typeLabel = match($form->model->type) { \App\Enums\OrderType::DineIn => 'Dine In', \App\Enums\OrderType::Takeaway => 'Takeaway', \App\Enums\OrderType::Delivery => 'Delivery', \App\Enums\OrderType::Pos => 'POS', default => $form->model->type->value ?? $form->model->type, }; @endphp {{ $typeLabel }}
{{ __('dashboard.print') }} @if($readOnly) {{ __('dashboard.read_only') }} @endif @unless($readOnly) {{ __('dashboard.delete') }} @endunless
@endunless {{-- @if($readOnly && $editLockReason)
{{ __('dashboard.note') }}: {{ $editLockReason }}
@endif --}} @unless($isSlideOver)

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

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

{{ $this->currentStatusLabel }}
@if ($this->nextStatus) @endif
@foreach ($this->statusSteps as $index => $step)
@if($step['completed']) @elseif($step['active'])
@else {{ $index + 1 }} @endif
{{ $step['label'] }}
@if(!$loop->last)
@endif @endforeach
@endunless
@if($isSlideOver) @php $allowedParams = \App\Enums\OrderStatus::allowedForType($form->model->type); $currentIdx = array_search($form->model->status, $allowedParams); $totalSteps = count($allowedParams); $progress = $totalSteps > 1 ? ($currentIdx / ($totalSteps - 1)) * 100 : 0; if ($form->model->status === \App\Enums\OrderStatus::Completed) { $progress = 100; } @endphp

#{{ $form->model->id }}

{{ $form->model->type->label() }} @if($form->model->table) {{ $form->model->table->name }} @endif • {{ $form->model->created_at->format('H:i') }}
{{ $form->model->status->label() }} @if ($this->nextStatus) @endif
@if($form->model->deliveryAgent)
{{ $form->model->deliveryAgent->initials() }}
{{ __('dashboard.driver') }} {{ $form->model->deliveryAgent->name }}
@endif @endif

{{ __('dashboard.order_items') }} ({{ count($orderItems) }})

@unless($readOnly) {{ __('dashboard.add_item') }} @endunless
@forelse ($orderItems as $line)
{{ $line['qty'] }}x

{{ $line['name'] }}

@php $grouped = collect($line['options'])->groupBy(fn($opt) => $opt['group'] ?: '-'); @endphp @if($grouped->isNotEmpty())
@foreach ($grouped as $groupName => $opts) @foreach ($opts as $opt) {{ $opt['name'] }} @if ((float) ($opt['additional_price'] ?? 0) !== 0.0) +{{ currency((float) $opt['additional_price']) }} @endif @endforeach @endforeach
@endif
{{ currency((float) $line['base_price']) }} each
{{ currency((float) $line['line_total']) }}
@unless($readOnly)
{{ $line['qty'] }}
@endunless
@empty

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

@endforelse
{{ __('dashboard.type') }} {{ $form->model->type->label() }}
{{ __('dashboard.subtotal') }} {{ currency($form->subtotal) }}
@if($form->discount > 0)
{{ __('dashboard.discount') }} -{{ currency($form->discount) }}
@endif
{{ __('dashboard.tax') }} {{ currency($form->tax) }}
{{ __('dashboard.total') }} {{ currency($form->total) }}
@if(!$form->model->isPaid() && !$form->model->isClosed()) @endif @if($isSlideOver)
{{-- {{ __('dashboard.print') }} --}} @if($this->canCancel) @endif @unless($readOnly) @endunless
@endif

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

{{-- @if($form->type !== 'delivery')
@foreach($branches as $branch) @endforeach @foreach($tables as $table) @endforeach
@else @foreach($branches as $branch) @endforeach @endif --}}
{{ __('dashboard.billed_status') }}
{{ $form->model->billed ? __('dashboard.billed') : __('dashboard.not_billed') }}
{{ __('dashboard.payment_status') }}
{{ $form->model->payment_status?->label() ?? 'Unpaid' }}
@unless($readOnly)
{{ __('dashboard.delete') }} {{ __('dashboard.save_changes') }}
@endunless

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

@forelse($histories as $history)
@if($history['type'] === 'status_change') @elseif($history['type'] === 'payment') @else @endif
{!! Str::markdown($history['description']) !!}
@if($history['user_avatar']) @else
{{ substr($history['user'], 0, 1) }}
@endif {{ $history['user'] }}
{{ $history['date'] }}
@empty
{{ __('dashboard.no_history') }}
@endforelse
@unless($readOnly) @endunless @if(!$readOnly && $confirmingDeleteItemId)

{{ __('dashboard.remove_item') }}?

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

@endif @if ($showDeliveryAgentModal)

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

@forelse ($deliveryAgents as $agent)
{{ $agent->initials() }}

{{ $agent->name }}

{{ $agent->phone ?? 'No Phone' }}

@empty

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

@endforelse
@endif @if ($showCancelModal)

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

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

@error('cancelReason') {{ $message }} @enderror
@endif @if($showPaymentModal)

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

$
@foreach($paymentMethods as $method) @endforeach
{{ __('dashboard.cancel') }} {{ __('dashboard.confirm_payment') }}
@endif