@extends('admin.layouts.app') @section('title', 'Order ' . $order->order_number) @push('styles') @endpush @section('content') @php $sc = match($order->status) { 'pending'=>'status-pending','confirmed'=>'status-confirmed','processing'=>'status-processing', 'shipped'=>'status-shipped','delivered'=>'status-delivered','cancelled'=>'status-cancelled', default=>'badge-gray' }; $pc = match($order->payment_status) { 'pending'=>'pay-pending','partial'=>'pay-partial','paid'=>'pay-paid',default=>'badge-gray' }; @endphp
{{-- LEFT --}}
{{-- Customer & addresses --}}
Customer & Addresses
@csrf @method('PATCH')
@if($errors->any())
{{ $errors->first() }}
@endif
{{-- Pricing & Tax --}}
Pricing & Tax
{{-- Items --}}
Order Items
@if($order->grand_total > 0) Grand Total: {{ $order->grand_total_inr }} @elseif($order->total_amount > 0) Subtotal: {{ $order->total_amount_inr }} @endif
@csrf
@foreach($order->items as $i => $item) @endforeach
Product Grade Qty Unit price (₹) Line total Notes
{{ $item->product_name }}
@if($item->product_sku)
{{ $item->product_sku }}
@endif
@if($item->grade) {{ $item->grade }} @else — @endif
{{ $item->line_total > 0 ? $item->line_total_inr : '—' }}
{{-- Shipments --}}
Shipment Tracking
{{-- Timeline of existing shipments --}} @if($order->shipments->count())
@foreach($order->shipments as $sh) @php $shc = 'ship-'.$sh->status; $dotClass = match($sh->status) { 'delivered' => 'success', 'exception' => 'warn', 'dispatched','in_transit','out_for_delivery' => 'active', default => '', }; @endphp
{{ \App\Models\OrderShipment::statusLabel($sh->status) }} @if($sh->courier_name){{ $sh->courier_name }}@endif @if($sh->tracking_number) @if($sh->tracking_url) {{ $sh->tracking_number }} ↗ @else {{ $sh->tracking_number }} @endif @endif
@if($sh->notes)
{{ $sh->notes }}
@endif
Added {{ $sh->created_at->format('d M Y, g:ia') }} @if($sh->estimated_delivery) · Est. delivery: {{ $sh->estimated_delivery->format('d M Y') }}@endif
{{-- Inline update form --}}
@csrf @method('PATCH')
@endforeach
@else

No shipment entries yet.

@endif {{-- Add new shipment --}}
Add shipment entry
@csrf
{{-- RIGHT sidebar --}}
{{-- Order status --}}
Order Status
@csrf @method('PATCH')
Created: {{ $order->created_at->format('d M Y, g:ia') }}
@if($order->confirmed_at) Confirmed: {{ $order->confirmed_at->format('d M Y') }}
@endif @if($order->shipped_at) Shipped: {{ $order->shipped_at->format('d M Y') }}
@endif @if($order->delivered_at) Delivered: {{ $order->delivered_at->format('d M Y') }}
@endif @if($order->estimated_delivery_date) Est. delivery: {{ $order->estimated_delivery_date->format('d M Y') }} @endif
{{-- Assign --}}
Assigned to
@csrf @method('PATCH')
{{-- Pricing summary --}} @if($order->total_amount > 0)
Price Breakdown
Subtotal{{ $order->total_amount_inr }}
@if($order->gst_percent > 0)
GST ({{ $order->gst_percent }}%){{ $order->gst_amount_inr }}
@endif @if($order->discount_amount > 0)
{{ $order->discount_label ?: 'Discount' }}-{{ $order->discount_amount_inr }}
@endif @if($order->shipping_amount > 0)
{{ $order->shipping_label ?: 'Shipping' }}{{ $order->shipping_amount_inr }}
@endif
Grand Total {{ $order->grand_total > 0 ? $order->grand_total_inr : $order->total_amount_inr }}
@endif {{-- Quick info --}} @if($order->quote)
Source Quote
{{ $order->quote->quote_number }}
{{ $order->quote->created_at->format('d M Y') }}
@endif
@endsection