@extends('layouts.backoffice') @section('content')

Order Details

@php $statuses = getStatus(); $status = "Unknown"; if (array_key_exists($order->status, $statuses)) { $statusClass = match ($order->status) { -1 => 'bg-danger-subtle text-danger', 0 => 'bg-secondary-subtle text-secondary', 2 => 'bg-primary-subtle text-primary', 3 => 'bg-info-subtle text-info', 4 => 'bg-warning-subtle text-warning', 1 => 'bg-success-subtle text-success', default => 'bg-secondary-subtle text-secondary', }; $status = '' . $statuses[$order->status] . ''; } $collect_method = 'Unknown'; if($order->collect_method == 'D'){ $collect_method = 'Delivery'; } elseif($order->collect_method == 'P'){ $collect_method = 'Pickup'; } elseif($order->collect_method == 'PL'){ $collect_method = 'Pickup Location'; } @endphp
QR Code

Scan this QR code using the Driver App or Pickup Location App to manage the order status.

@if($order->collect_method == 'D')
{{ $order->customer->first_name.' '.$order->customer->last_name }}
{{ $order->customer->mobile ?? $order->customer->email }}
@if(!is_null($order->order_pickup))
{{ $order->order_pickup->country }}
{{ $order->order_pickup->city }}
{{ $order->order_pickup->street }}
{{ $order->order_pickup->address }}
@endif
@php $latitude = $order->order_pickup->latitude ?? null; $longitude = $order->order_pickup->longitude ?? null; $googleMapsLink = $latitude && $longitude ? "https://www.google.com/maps?q={$latitude},{$longitude}" : null; @endphp @if($googleMapsLink) Google Maps QR Code @endif

Scan this QR code using the Driver App to get the customer delivery location.
@endif @if($order->collect_method == 'PL')
{{ $order->pickup_location->name }}
{{ $order->pickup_location->city }}
{{ $order->pickup_location->street }}
{{ $order->pickup_location->address }}

Google Maps QR Code

Scan this QR code using your phone camera to view the pickup location on Google Maps.
@endif
{{ $order->code }}
{{ $datetime }}
{{ !empty($order->customer->email) ? $order->customer->email : $order->customer->mobile }} - {{ $order->customer->first_name.' '.$order->customer->last_name }}
{!! $status !!}
{{ $order->region->name }}
{{ is_null($order->store_id) ? '-' : $order->store->name }}
{{ $order->total_amount }}
{!! $collect_method !!}
{{ escapeNull($pickup_time, '-') }}
{{ escapeNull($delivery_time, '-') }}
@if($order->collect_method=='D' && !is_null($order->order_pickup))
Pickup Details
{{ is_null($order->order_pickup->driver) ? '-' : ($order->order_pickup->driver->first_name.' '.$order->order_pickup->driver->last_name.' ('.$order->order_pickup->driver->username.')') }}
{{ $order->order_pickup->country }}
{{ $order->order_pickup->city }}
{{ $order->order_pickup->street }}
{{ $order->order_pickup->address }}
{{ $order->order_pickup->latitude }}
{{ $order->order_pickup->longitude }}
@endif @if($order->collect_method=='PL' && !is_null($order->pickup_location))

Pickup Location Details

{{ is_null($order->pickup_location->driver) ? '-' : ($order->pickup_location->driver->first_name.' '.$order->pickup_location->driver->last_name.' ('.$order->pickup_location->driver->username.')') }}
{{ $order->pickup_location->name }}
{{ $order->pickup_location->country }}
{{ $order->pickup_location->city }}
{{ $order->pickup_location->street }}
{{ $order->pickup_location->address }}
{{ $order->pickup_location->phone }}
{{ $order->pickup_location->email }}
{{ $order->pickup_location->latitude }}
{{ $order->pickup_location->longitude }}
@endif
Order Items
@foreach($order->records as $record) @endforeach
Image Item Price Quantity SubTotal
{{ $record->store_item->name }} {{ $record->price }} {{ $record->quantity }} {{ ($record->quantity*$record->price) }}
@endsection