@extends('layouts.app') @section('title', 'Order ' . $order->order_number) @section('content')
@php $shippingRecord = $order->shippingRecords->first(); $needsShippingPayment = $shippingRecord && $shippingRecord->status === 'arrived_nigeria' && $order->shipping_cost > 0; @endphp @if($needsShippingPayment)

Shipping Fee Required

Your shipment has arrived in Nigeria. Please pay shipping fee of ₦{{ number_format($order->shipping_cost, 2) }} to proceed.

@endif

Order {{ $order->order_number }}

{{ $order->created_at->format('M d, Y H:i') }}

{{ ucfirst($order->payment_status) }} Payment

Order Items

@foreach($order->items as $item)
@if($item->product->images->first()) @endif

{{ $item->product->name }}

{{ $item->quantity }} x ₦{{ number_format($item->unit_price, 2) }}

₦{{ number_format($item->total, 2) }}

incl. ₦{{ number_format($item->shipping_cost, 2) }} shipping

@endforeach

Shipping Status

@foreach(['ordered', 'shipped_from_origin', 'in_transit', 'arrived_nigeria', 'ready_for_pickup', 'delivered'] as $index => $status)
{{ str_replace('_', ' ', ucfirst($status)) }}
@endforeach

Payment Summary

Subtotal ₦{{ number_format($order->subtotal, 2) }}
Shipping ₦{{ number_format($order->shipping_cost, 2) }}
Total ₦{{ number_format($order->total, 2) }}
Paid ₦{{ number_format($order->paid_amount, 2) }}
Balance ₦{{ number_format($order->total - $order->paid_amount, 2) }}
@if($order->payment_status !== 'paid')

Make Payment

@php $settings = \App\Models\Setting::pluck('value', 'key')->toArray(); @endphp

Bank Transfer

Bank: {{ $settings['bank_name'] ?? 'Not configured' }}

Account: {{ $settings['account_number'] ?? 'Not configured' }}

Name: {{ $settings['account_name'] ?? 'Not configured' }}

@csrf
@endif @if($order->payments->count() > 0)

Payment History

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

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

{{ $payment->created_at->format('M d, Y') }}

{{ ucfirst($payment->status) }}
@endforeach
@endif
@endsection