@extends('admin.layouts.app') @section('title', 'Order Details') @section('page-title', 'Order: ' . $order->order_number) @section('content')

Order Information

Placed on {{ $order->created_at->format('F d, Y h:i A') }}

{{ ucfirst($order->status) }}

Customer Information

Name: {{ $order->shipping_name }}

Email: {{ $order->shipping_email }}

Phone: {{ $order->shipping_phone ?? 'N/A' }}

Shipping Address

{{ $order->shipping_address }}

{{ $order->shipping_city }}, {{ $order->shipping_state }} {{ $order->shipping_postal_code }}

{{ $order->shipping_country }}

Order Items

@foreach($order->items as $item) @endforeach @if($order->discount > 0) @endif
Product Variant Quantity Price Subtotal
{{ $item->product_name }} {{ $item->variant_name ?? '-' }} {{ $item->quantity }} {{ $currency_symbol }}{{ number_format($item->price, 2) }} {{ $currency_symbol }}{{ number_format($item->subtotal, 2) }}
Subtotal: {{ $currency_symbol }}{{ number_format($order->subtotal, 2) }}
Tax: {{ $currency_symbol }}{{ number_format($order->tax, 2) }}
Shipping: {{ $currency_symbol }}{{ number_format($order->shipping, 2) }}
Discount: -{{ $currency_symbol }}{{ number_format($order->discount, 2) }}
Total: {{ $currency_symbol }}{{ number_format($order->total, 2) }}
@if(!$order->delivery_agent_id && in_array($order->status, ['paid', 'pending']))

Assign to delivery boy

@csrf
@elseif($order->delivery_agent_id)

Delivery

Assigned to: {{ $order->deliveryAgent->user->name ?? 'N/A' }} ({{ $order->deliveryAgent->agent_code ?? 'N/A' }})

Delivery status: {{ $order->delivery_status ?? 'N/A' }}

@php $assignment = $order->deliveryAssignment; @endphp @if($assignment)

Delivery fee (to wallet): {{ $currency_symbol ?? '$' }}{{ number_format($assignment->delivery_fee ?? $order->delivery_fee ?? 0, 2) }}

@if(($assignment->bonus ?? 0) > 0)

Bonus: {{ $currency_symbol ?? '$' }}{{ number_format($assignment->bonus, 2) }}

@endif @if(($assignment->tip ?? 0) > 0)

Customer tip (to wallet): {{ $currency_symbol ?? '$' }}{{ number_format($assignment->tip, 2) }}

@endif @endif
@endif

Update Order Status

@csrf @method('PUT')
@if($order->payments->count() > 0)

Payment Information

@foreach($order->payments as $payment)

{{ ucfirst($payment->payment_method) }}

{{ $payment->payment_intent_id ?? 'N/A' }}

{{ $currency_symbol }}{{ number_format($payment->amount, 2) }}

{{ ucfirst($payment->status) }}
@endforeach
@endif
Back to Orders View Invoice
@endsection