{{ siteName() }}

@if($order->shipping_address && is_array($order->shipping_address)) {{ $order->shipping_address['address_line1'] ?? '' }}, {{ $order->shipping_address['city'] ?? '' }} @endif

{{ $order->is_pos ? 'Point of Sale Receipt' : 'Payment Receipt' }}
Order {{ $order->order_number }}
Date {{ $order->paid_at ? $order->paid_at->format('M d, Y H:i') : $order->created_at->format('M d, Y H:i') }}
Customer {{ $order->customer?->name ?? 'Walk-in Customer' }}

Item Qty   Total
@foreach($order->items as $item)
{{ $item->product_name ?? ($item->product?->name ?? 'Product') }} x{{ $item->quantity }} {{ price($item->subtotal) }}
@endforeach
Subtotal {{ price($order->subtotal) }}
@if($order->discount > 0)
Discount -{{ price($order->discount) }}
@endif
Tax {{ price($order->tax) }}
@if($order->shipping_cost > 0)
Shipping {{ price($order->shipping_cost) }}
@endif
TOTAL {{ price($order->total) }}

Payment Method: {{ $order->payment?->first()?->payment_method ?? $order->payment_method ?? 'N/A' }}

Transaction ID: {{ $order->payment?->first()?->transaction_id ?? $order->payment_transaction_id ?? 'N/A' }}

@php $payment = $order->payment?->first(); $change = 0; if ($payment && $payment->gateway_response) { $resp = is_array($payment->gateway_response) ? $payment->gateway_response : json_decode($payment->gateway_response, true); $change = $resp['change'] ?? 0; } @endphp @if($change > 0)

Change: {{ price($change) }}

@endif