@php $paidSoFar = $order->payments->sum('amount'); $remaining = max(0, $order->total - $paidSoFar); @endphp
@if ($order)
Order #{{ $order->order_number }}
{{ ucfirst(str_replace('_',' ',$order->status)) }}

{{ ucfirst(str_replace('_',' ',$order->order_type)) }}

@if ($order->placed_by_customer && $order->status === 'open')
📱 Placed by customer via QR menu — review before sending to kitchen
@endif
@csrf
@if ($order->items->count() > 1) @endif
Subtotal{{ number_format($order->subtotal, 2) }}
Tax{{ number_format($order->tax, 2) }}
@if ($order->service_charge > 0)
Service Charge{{ number_format($order->service_charge, 2) }}
@endif @if ($order->discount > 0)
Discount {{ $order->coupon ? '('.$order->coupon->code.')' : '' }} -{{ number_format($order->discount, 2) }}
@endif
Total{{ number_format($order->total, 2) }}
@if ($paidSoFar > 0)
Paid so far{{ number_format($paidSoFar, 2) }}
Balance Due{{ number_format($remaining, 2) }}
@endif
@if ($order->status === 'open')
@csrf
@else
@csrf
@endif @if ($otherOpenOrders->count()) @endif @can('payments.take') @endcan
@endif