@if ($order)

{{ __('app.view_order') }} #{{ $order->id }}

{{ __('app.status') }}: {{ $order->status }}
{{ __('app.date_time') }}: {{ $order->created_at?->format('d M Y - H:i') }}
{{-- Client & Restaurant --}}

{{ __('app.client') }}

{{ $order->client->user->name }}

{{ __('app.restaurant') }}

{{ $order->restaurant->user->name }}

{{-- Order Items --}} @if ($order->products->isNotEmpty())

{{ __('app.order_items') }}

@foreach ($order->products as $product)
{{-- Product Image --}} {{ $product->name }} {{-- Product Info --}}

{{ $product->name }}

{{ number_format($product->price, 2) }} {{ settings('currency_symbol') }}

@php $variant = collect($product->variants)->firstWhere('name', $product->pivot->variants,); $addon = collect($product->addons)->firstWhere('name', $product->pivot->addons); @endphp @if ($product->pivot->variants)

{{ __('app.variants') }}: {{ $product->pivot->variants }} @if ($variant) (+{{ number_format($variant['price'], 2) }} {{ settings('currency_symbol') }}) @endif

@endif @if ($product->pivot->addons)

{{ __('app.addons') }}: {{ $product->pivot->addons }} @if ($addon) (+{{ number_format($addon['price'], 2) }} {{ settings('currency_symbol') }}) @endif

@endif
{{-- Quantity & Total --}}

x{{ $product->pivot->quantity }}

{{ number_format($product->price * $product->pivot->quantity, 2) }} {{ settings('currency_symbol') }}

@endforeach
@endif {{-- Note --}} @if ($order->note)

{{ __('app.note') }}

{{ __('app.note') }}:
{{ $order->note }}
@endif {{-- Pricing --}}

{{ __('app.pricing') }}

{{ __('app.sub_total') }} {{ number_format($order->sub_total, 2) }} {{ settings('currency_symbol') }}
{{ __('app.delivery_fee') }} {{ number_format($order->delivery_fee, 2) }} {{ settings('currency_symbol') }}
{{ __('app.night_multiplier') }} x{{ $order->night_multiplier }}
{{ __('app.demand_multiplier') }} x{{ $order->demand_multiplier }}
{{ __('app.peak_multiplier') }} x{{ $order->peak_multiplier }}
{{ __('app.total') }} {{ number_format($order->total, 2) }} {{ settings('currency_symbol') }}
{{-- Client --}}

{{ __('app.client') }}

{{ __('app.name') }} {{ $order->client->user->name }}
{{ __('app.username') }} {{ $order->client->username }}
{{ __('app.phone') }} {{ $order->client->user->phone }}
{{ __('app.email') }} {{ $order->client->user->email }}
{{-- Driver --}} @if ($order->driver)

{{ __('app.driver') }}

{{ __('app.name') }} {{ $order->driver->user->name }}
{{ __('app.phone') }} {{ $order->driver->user->phone }}
{{ __('app.email') }} {{ $order->driver->user->email }}
{{ __('app.image') }} @if ($order->driver->image) {{ $order->driver->user->name }} @else {{ $order->driver->user->name }} @endif
@endif {{-- Delivery Information --}}

{{ __('app.delivery_information') }}

{{ __('app.address') }}

{{ $order->address }}

LNG

{{ $order->lng }}

LAT

{{ $order->lat }}

@if ($order->note)

{{ __('app.note') }}

{{ $order->note }}

@endif
{{-- Footer --}}
@if ($user?->restaurant?->id == $order->restaurant?->id) @if ($order->status === \App\Enums\OrderStatusEnum::PENDING) @elseif ($order->status === \App\Enums\OrderStatusEnum::PREPARING && $order->driver != null) @endif @endif
@endif