@extends('admin.layouts.app') @section('title', 'Order Detail') @section('content')

Order #{{ $order->order_number }}

{{ orderStatuses($order->order_status) }}
Customer Detail
@php $image = DEFAULT_PATH; if (!empty($order->customer->image)) { $image = $order->customer->image; } @endphp Customer Image

{{ $order->customer->full_name }}

Email : {{ $order->customer->email }}

Phone Number : {{ $order->customer->mobile_number }}

{{ $orderCount }} Orders

@if (in_array($order->order_status, [0, 1, 2])) @can('status-update-order')
Update Status
@method('put')
@endcan @elseif(in_array($order->order_status, [4, 5]) && $order->is_refund == 0)
@can('view-order-detail-order') @if ($order->order_status == 5)

Return Reason :

 Defective items received

@elseif ($order->order_status == 4)

Cancel Reason :

 Defective items received

@endif @endcan @if (auth()->user()->hasPermissionTo('approve-order'))
@method('put')
@endif @can('status-update-order')
@method('put')
@endcan
@elseif(in_array($order->order_status, [4, 5]) && $order->is_refund == 1)
@if ($order->order_status == 5)

Return Reason :

 Defective items received

@elseif ($order->order_status == 4)

Cancel Reason :

 Defective items received

@endif
Refund has been done
@endif
Order Detail
{{-- order detail in loop --}} @if (isset($order->orderDetails) && count($order->orderDetails) > 0) @foreach ($order->orderDetails as $item) @endforeach
Product Name Price in USD Price in MMK Quantity Total Returned Approval Pickup Refund Restock
{{ $item->product_name }} {{ $item->price_usd }} {{ $item->price_mmk }} {{ $item->quantity }} {{ $item->total }}
@endif
{{--
Subtotal:
$2093
--}} {{--
Wholesale Discount:
N/A
--}} {{--
Tax:
$28
--}}
Total(USD):
{{ $order->total_price_usd }}
Total(MMK):
{{ $order->total_price_mmk }}
{{-- shipping billing and status timeline --}}
Shipping Address

{{ $order->shippingAddress->address }}
{{ $order->shippingAddress->city }}, {{ $order->shippingAddress->state }} Myanmar, {{ $order->shippingAddress->pincode }}

Billing Address

{{ $order->billingAddress->address }}
{{ $order->billingAddress->city }}, {{ $order->billingAddress->state }} Myanmar, {{ $order->billingAddress->pincode }}

Shipping Activity
@php $logs = $order->orderStatusLogs; $logsByStatus = $logs->keyBy('status'); $isRefund = $order->is_refund == 1; $statusToShow = getOrderStatusFlow($logs, $isRefund); @endphp
@foreach ($statusToShow as $loopIndex => $key) @php $status = orderStatuses($key); $log = $logsByStatus->get($key); $isActive = !is_null($log); // Refund is now logged in DB, so just check presence @endphp
{{ $status }}
@if ($isActive) {{ dateInList($log->status_date_time) }} @else Not yet updated @endif
@endforeach
@endsection