@extends('layouts.app') @section('title', 'Order #'.optional($order)->order_number) @section('breadcrumbs') @endsection @section('content')

{{ $order->order_number }}

Order for {{ $order->customer->name ?? 'N/A' }} | Created {{ $order->created_at->format('d M Y') }}

Edit
@include('export.orders.partials._status-timeline')
Order Details
Order #{{ $order->order_number }}
Date{{ $order->date?->format('d M Y') ?? 'N/A' }}
Buyer PO{{ $order->buyer_po_number ?? 'N/A' }}
Incoterm{{ $order->incoterm ?? 'N/A' }}
Shipment Info
Loading Port{{ $order->port_of_loading->name ?? 'N/A' }}
Discharge Port{{ $order->port_of_discharge->name ?? 'N/A' }}
ETD{{ optional($order->etd)->format('d M Y') ?? 'TBD' }}
ETA{{ optional($order->eta)->format('d M Y') ?? 'TBD' }}
Cargo Summary
Quantity{{ $order->quantity ?? 0 }} {{ $order->unit }}
Gross Weight{{ number_format($order->gross_weight ?? 0, 3) }} MT
Volume{{ number_format($order->volume ?? 0, 3) }} CBM
Containers{{ $order->no_of_containers ?? 0 }} x {{ strtoupper($order->container_size ?? '') }}
@forelse($order->items as $index => $item) @empty @endforelse
#ProductDescriptionQtyUnit PriceAmount
{{ $index + 1 }} {{ $item->product->name ?? 'N/A' }} {{ $item->description }} {{ number_format($item->quantity, 2) }} {{ $item->unit }} {{ number_format($item->unit_price, 2) }} {{ number_format($item->quantity * $item->unit_price, 2) }}
No items
Total{{ number_format($order->total_amount, 2) }} {{ $order->currency }}
@if($order->packingList) @else

No packing list created

@if($order->status !== 'draft')Create Packing List@endif
@endif
@forelse($order->bookings as $booking)
{{ $booking->booking_number ?? 'N/A' }}
{{ $booking->shippingLine->name ?? 'N/A' }} | {{ $booking->vessel_name ?? '' }} V.{{ $booking->voyage_number ?? '' }}
{{ ucfirst($booking->status) }}
@empty

No bookings yet

@endforelse
Manage order documents
@foreach(['commercial_invoice' => 'Commercial Invoice', 'packing_list' => 'Packing List', 'certificate_of_origin' => 'Certificate of Origin', 'shipping_bill' => 'Shipping Bill', 'bill_of_lading' => 'Bill of Lading', 'insurance' => 'Insurance'] as $key => $label)
{{ $label }}
@if(isset($order->documents[$key])) @else @endif
@endforeach
Payment Summary
Order Value{{ number_format($order->total_amount, 2) }} {{ $order->currency }}
Received{{ number_format($order->received_amount ?? 0, 2) }}
Balance{{ number_format($order->total_amount - ($order->received_amount ?? 0), 2) }}
Expenses
@forelse($order->expenses as $exp) @empty @endforelse
{{ $exp->description }}{{ number_format($exp->amount, 2) }}
No expenses recorded
@forelse($order->activities ?? [] as $activity)

{{ $activity->description }}

{{ $activity->created_at->diffForHumans() }} by {{ $activity->user->name ?? 'System' }}
@empty
No activity recorded
@endforelse
@endsection