@extends('layouts.admin') @php $currencySymbol = $currencySymbol ?? App\Models\AppSetting::getValue('currency_symbol', '?'); @endphp @php $serviceType = $order->service_type ?? 'food'; $isParcelOrder = $serviceType === 'parcel'; @endphp @section('title', 'Order Details') @section('header', 'Complete Order Details') @section('content')
Order Value
{{ $currencySymbol }}{{ number_format($order->total ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Delivery Fee
{{ $currencySymbol }}{{ number_format($order->delivery_fee ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Driver Income
{{ $currencySymbol }}{{ number_format($order->driver_earning ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Admin Revenue
{{ $currencySymbol }}{{ number_format($order->admin_commission ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Order Information
{{ ucfirst($serviceType) }}
{{ ucfirst(str_replace('_', ' ', $order->status)) }}
{{ ucfirst(str_replace('_', ' ', $order->payment_method ?? 'N/A')) }}
{{ ucfirst(str_replace('_', ' ', $order->payment_status ?? 'N/A')) }}
{{ ucfirst(str_replace('_', ' ', $order->delivery_payment_mode ?? 'N/A')) }}
{{ $isParcelOrder ? ucfirst($order->parcelOrder->package_type ?? 'Parcel') : ($order->restaurant->name ?? 'N/A') }}
{{ $order->customer_name ?? 'N/A' }}
{{ is_array($order->customer_address) ? ($order->customer_address['address'] ?? json_encode($order->customer_address)) : ($order->delivery_address ?? 'N/A') }}
@if($isParcelOrder && $order->parcelOrder)
Parcel Details
{{ $order->parcelOrder->pickup_address['address'] ?? $order->parcelOrder->pickup_address['line1'] ?? 'N/A' }}
{{ $order->parcelOrder->drop_address['address'] ?? $order->parcelOrder->drop_address['line1'] ?? 'N/A' }}
{{ $order->parcelOrder->receiver_name ?? 'N/A' }} {{ $order->parcelOrder->receiver_phone ? '(' . $order->parcelOrder->receiver_phone . ')' : '' }}
{{ $order->parcelOrder->content ?? 'N/A' }}
@endif
Financial Breakdown
{{ $currencySymbol }}{{ number_format($order->subtotal ?? 0, App\Models\AppSetting::currencyDecimals()) }}
{{ $currencySymbol }}{{ number_format($order->tax ?? 0, App\Models\AppSetting::currencyDecimals()) }}
-{{ $currencySymbol }}{{ number_format($order->discount ?? 0, App\Models\AppSetting::currencyDecimals()) }}
{{ $currencySymbol }}{{ number_format($order->platform_commission ?? 0, App\Models\AppSetting::currencyDecimals()) }}
{{ $currencySymbol }}{{ number_format($order->payment_gateway_fee ?? 0, App\Models\AppSetting::currencyDecimals()) }}
{{ $currencySymbol }}{{ number_format($order->gst_on_commission ?? 0, App\Models\AppSetting::currencyDecimals()) }}

{{ $currencySymbol }}{{ number_format($order->restaurant_earning ?? 0, App\Models\AppSetting::currencyDecimals()) }}
{{ $currencySymbol }}{{ number_format($order->driver_earning ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Items
@if(is_array($order->items) && count($order->items)) @foreach($order->items as $item) @endforeach @else @endif
Name Quantity Price
{{ $item['name'] ?? 'Item' }} {{ $item['quantity'] ?? 1 }} {{ $currencySymbol }}{{ number_format($item['price'] ?? 0, App\Models\AppSetting::currencyDecimals()) }}
No items data available
@unless($isParcelOrder)
Store Details
{{ $order->restaurant->name ?? 'N/A' }}
{{ $order->restaurant->email ?? '' }}
Address
{{ $order->restaurant->address ?? 'N/A' }}
@endunless
Transaction Summary
Payment ID
{{ $order->payment_id ?? '—' }}
Cash Collected
{{ $currencySymbol }}{{ number_format($order->cash_collected_amount ?? 0, App\Models\AppSetting::currencyDecimals()) }}
Delivery OTP
{{ $order->delivery_otp ?? '—' }}
@endsection