{{-- POS receipt — designed for 80mm thermal printer width. When the seller clicks "Print receipt" in the POS UI, the browser opens this view in a new tab and triggers print. The CSS forces a narrow page width so that on a typical thermal printer driver the receipt comes out cleanly with no cropping. Auto-print fires once the document is loaded. --}} Receipt #{{ $order->id }} @php $receiptCurrencyCode = strtoupper((string) ($order->currency_code ?? $order->base_currency_code ?? '')); $receiptMoney = fn ($amount) => \App\Support\Currency\CurrencyDisplay::format($amount, $receiptCurrencyCode, $currencySymbol ?? null); @endphp
{{ $store->name }}
@if(!empty($store->address))
{{ $store->address }}
@endif
@if(!empty($store->city)){{ $store->city }}@endif{{-- --}} @if(!empty($store->state)), {{ $store->state }}@endif{{-- --}} @if(!empty($store->zipcode)) — {{ $store->zipcode }}@endif
@if(!empty($store->contact_number))
Tel: {{ $store->contact_number }}
@endif @if(!empty($store->tax_name) && !empty($store->tax_number))
{{ $store->tax_name }}: {{ $store->tax_number }}
@endif
Order #{{ $order->id }}
Date{{ $order->created_at->format('Y-m-d H:i') }}
Customer {{ $customerName }}
@if(!empty($customerMobile))
Mobile{{ $customerMobile }}
@endif @php $paymentLabel = match ($order->payment_method) { 'pos_upi' => 'UPI', 'cod' => 'Cash', 'razorpayPayment' => 'Razorpay', 'stripePayment' => 'Stripe', 'paystackPayment' => 'Paystack', 'flutterwavePayment' => 'Flutterwave', default => strtoupper((string) $order->payment_method), }; $splitCash = (float) ($order->pos_split_cash ?? 0); // Split-tender sale: cashier collected $splitCash in cash and rest online. $isSplit = $splitCash > 0 && $splitCash < (float) $order->final_total; @endphp
Payment{{ $isSplit ? 'Split' : $paymentLabel }} ({{ $order->payment_status }})
@if($isSplit)
  Cash{{ $receiptMoney($splitCash) }}
  {{ $paymentLabel }}{{ $receiptMoney((float) $order->final_total - $splitCash) }}
@endif
@foreach($order->items as $item) @php $qty = (float) $item->quantity; $addonUnitTotal = (float) $item->addons->sum(fn ($addon) => (float) $addon->price); $itemUnitTotal = $qty > 0 ? round((float) $item->subtotal / $qty, 2) : (float) $item->subtotal; $productUnitPrice = max(0, round($itemUnitTotal - $addonUnitTotal, 2)); $pricingLine = $addonUnitTotal > 0 ? 'Product '.$receiptMoney($productUnitPrice).' + Add-ons '.$receiptMoney($addonUnitTotal) : 'Product '.$receiptMoney($productUnitPrice); @endphp @endforeach
Item Qty Amount
{{ $item->title }} @if(!empty($item->variant_title) && strcasecmp($item->variant_title, 'Default') !== 0)
{{ $item->variant_title }}
@endif
{{ $pricingLine }}
@if($item->relationLoaded('addons') && $item->addons->isNotEmpty()) @foreach($item->addons as $addon)
@if(!empty($addon->addonGroup?->title)) {{ $addon->addonGroup->title }}: @endif {{ $addon->addonItem?->title ?? 'Addon' }} @if((float) $addon->price > 0) ({{ $receiptMoney($addon->price) }}) @else (free) @endif
@endforeach @endif
{{ rtrim(rtrim(number_format((float)$item->quantity, 2, '.', ''), '0'), '.') }} {{ $receiptMoney($item->subtotal) }}

@php // Tax breakdown by rate — items at the same % collapse into one row // so the customer sees "Tax @ 5% — ₹X" + "Tax @ 18% — ₹Y" instead // of an opaque "incl. tax" total. Skips 0% items. $byRate = []; foreach ($order->items as $i) { $rate = (float) $i->tax_percent; if ($rate <= 0) continue; $key = number_format($rate, ($rate == (int) $rate) ? 0 : 2, '.', ''); $byRate[$key] = ($byRate[$key] ?? 0) + (float) $i->tax_amount; } ksort($byRate, SORT_NUMERIC); $taxTotal = array_sum($byRate); $savingsTotal = (float) ($order->pos_savings ?? 0); // Subtotal exclusive-of-tax (what the items would have cost without // any tax) — clearer than showing the inclusive subtotal + a // separate tax row that confuses people. $subtotalExTax = max(0.0, (float) $order->subtotal - $taxTotal); @endphp
Subtotal{{ $receiptMoney($subtotalExTax) }}
@foreach($byRate as $rate => $amount)
  Tax @ {{ $rate }}%{{ $receiptMoney($amount) }}
@endforeach @if($taxTotal > 0)
Total tax{{ $receiptMoney($taxTotal) }}
@endif @if($savingsTotal > 0)
You saved (sale price)-{{ $receiptMoney($savingsTotal) }}
Savings noteAlready included in total
@endif @if((float)$order->promo_discount > 0)
Discount-{{ $receiptMoney($order->promo_discount) }}
@endif
TOTAL{{ $receiptMoney($order->final_total) }}