{{-- One template for both admin & customer --}} Order #{{ $order->order_no }} @if($toAdmin)

New Order Received

An order has been placed on {{ $appName }}.

@else

Thanks for your purchase!

We’ve received your order #{{ $order->order_no }}. A summary is below.

Please fill out the required Compulsory Buying Form:

Fill the Compulsory Buying Form

@endif

Order #: {{ $order->order_no }}
Date: {{ $order->created_at->format('Y-m-d H:i') }}
Status: {{ ucfirst($order->status) }}
Total: £{{ number_format((float)$order->total_gbp, 2) }}

@php $calcTotal = 0; @endphp @foreach($order->items as $i => $item) @php $qty = (int)($item->qty ?? $item->quantity ?? 0); $unit = (float)($item->unit_gbp ?? $item->price_gbp ?? 0); $line = (float)($item->line_gbp ?? ($qty * $unit)); $calcTotal += $line; @endphp @endforeach
# Item Qty Unit (GBP) Line Total
{{ $i+1 }} {{ $item->title ?? $item->name ?? 'Item' }} {{ $qty }} {{ number_format($unit, 2) }} {{ number_format($line, 2) }}

@if(!is_null($order->subtotal_gbp)) Subtotal: £{{ number_format((float)$order->subtotal_gbp, 2) }}
@endif @if(!is_null($order->vat_gbp)) VAT: £{{ number_format((float)$order->vat_gbp, 2) }}
@endif Total: £{{ number_format((float)($order->total_gbp ?? $calcTotal), 2) }}

@if($toAdmin)

Customer: {{ $order->customer_name ?? $order->user?->name ?? '—' }} ({{ $order->customer_email ?? $order->user?->email ?? '—' }})

@else

If you have any questions, just reply to this email. Thanks for shopping with {{ $appName }}!

@endif