@extends('layouts.app') @section('title', __('Order #:number', ['number' => $order->order_number])) @php /* * Administrative totals follow the currency selected in Payment Settings. * The money() helper supplies the configured symbol and number format. */ $displayCurrency = default_currency(); /* * Some legacy date fields may be returned as strings instead of Carbon * instances. Parse the value safely before displaying it. */ $formatAdminDate = static function ( mixed $value, string $format = 'M d, Y H:i' ): string { if (blank($value)) { return __('N/A'); } try { return \Illuminate\Support\Carbon::parse($value) ->format($format); } catch (\Throwable) { return __('N/A'); } }; @endphp @section('content')
{{-- Breadcrumb --}}

Order #{{ $order->order_number }}

@if($availableActions['can_generate_invoice'] ?? false)
@csrf
@endif @if($availableActions['has_invoice'] ?? false) View Invoice @endif Back
{{-- Order Status Banner --}}
Order Status @if($order->status == 0) Active @elseif($order->status == 1) Completed @elseif($order->status == 2) Cancelled @else Unknown @endif
Payment Status {{ ucfirst(str_replace('_', ' ', $order->payment_status ?? 'N/A')) }}
Payment Method {{ $order->payment_method ?? 'N/A' }}
Total {{ money($order->price_total ?? 0, $displayCurrency) }}
Date {{ $formatAdminDate($order->created_at) }}
@if($availableActions['can_cancel'] ?? false) @endif
{{-- Stats Row --}}
@php $detailStats = [ ['label' => 'Total Items', 'value' => $stats['items_count'] ?? 0, 'icon' => 'fa-box', 'color' => 'primary'], ['label' => 'Total Quantity', 'value' => $stats['total_items'] ?? 0, 'icon' => 'fa-boxes', 'color' => 'info'], ['label' => 'Sellers', 'value' => $stats['sellers_count'] ?? 0, 'icon' => 'fa-store', 'color' => 'warning'], ['label' => 'Subtotal', 'value' => money($stats['subtotal'] ?? 0, $displayCurrency), 'icon' => 'fa-shopping-cart', 'color' => 'secondary'], ['label' => 'VAT', 'value' => money($stats['vat'] ?? 0, $displayCurrency), 'icon' => 'fa-percent', 'color' => 'info'], ['label' => 'Shipping', 'value' => money($stats['shipping'] ?? 0, $displayCurrency), 'icon' => 'fa-truck', 'color' => 'warning'], ['label' => 'Discount', 'value' => money($order->coupon_discount ?? 0, $displayCurrency), 'icon' => 'fa-tag', 'color' => 'danger'], ['label' => 'Total Refunded', 'value' => money($stats['total_refunded'] ?? 0, $displayCurrency), 'icon' => 'fa-undo', 'color' => 'danger'], ]; @endphp @foreach($detailStats as $stat)

{{ $stat['label'] }}

{{ $stat['value'] }}
@endforeach
{{-- Tabs --}}
{{-- Items Tab --}}
@include('admin.orders.partials.tab-items', [ 'order' => $order, 'itemStatuses' => $itemStatuses, ])
{{-- Shipping Tab --}}
@include('admin.orders.partials.tab-shipping', ['shippingInfo' => $shippingInfo])
{{-- Payments Tab --}}
@include('admin.orders.partials.tab-payments', ['paymentBreakdown' => $paymentBreakdown])
{{-- Refunds Tab --}}
@include('admin.orders.partials.tab-refunds', ['refunds' => $refunds])
{{-- Earnings Tab --}}
@include('admin.orders.partials.tab-earnings', [ 'earnings' => $earnings, 'affiliateEarnings' => $affiliateEarnings, 'sellerBreakdown' => $sellerBreakdown, ])
{{-- Timeline Tab --}}
@include('admin.orders.partials.tab-timeline', ['timeline' => $timeline])
{{-- Cancel Modal --}} {{-- Tracking Modal --}} @endsection @push('styles') @endpush @push('scripts') @endpush