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

@if($updatedAt) {{ __('dashboard.updated') ?? 'Updated' }} {{ \Carbon\Carbon::parse($updatedAt)->diffForHumans() }} @endif
@if($branch)
{{ __('dashboard.branch') }} {{ $branch['name'] ?? '' }}
@endif @if($area)
{{ __('dashboard.area') }} {{ $area['name'] ?? '' }}
@endif @if($table)
{{ __('dashboard.table') }} {{ $table['name'] ?? ('#'.$table['id']) }}
@endif @if($orderType)
{{ __('dashboard.type') }} {{ str_replace('_',' ', $orderType) }}
@endif
@forelse ($orderItems as $line)

{{ $line['name'] }}

{{ number_format((float) ($line['base_price'] ?? 0), 2) }} @if(!empty($line['qty'])) x {{ $line['qty'] }} @endif

@if (!empty($line['options']))
@foreach ($line['options'] as $opt)
{{ $opt['name'] ?? '' }} @if ((float) ($opt['additional_price'] ?? 0) !== 0.0) {{ number_format((float) $opt['additional_price'], 2) }} @endif
@endforeach
@endif
@php $optSum = collect($line['options'] ?? [])->sum(fn($opt) => (float) ($opt['additional_price'] ?? 0)); $lineTotal = (float) ($line['qty'] ?? 1) * (float) (($line['base_price'] ?? 0) + $optSum); @endphp {{ number_format($lineTotal, 2) }}
@empty

{{ __('dashboard.no') }} {{ __('dashboard.items') }} {{ __('dashboard.found') }}.

@endforelse
{{ __('dashboard.subtotal') }} {{ number_format($subtotal, 2) }}
{{ __('dashboard.discount') }} -{{ number_format($discount, 2) }}
{{ __('dashboard.tax') }} {{ number_format($tax, 2) }}
{{ __('dashboard.total') }} {{ number_format($total, 2) }}
@push('scripts') @if($cartKey) @endif @endpush