<!DOCTYPE html><html><head><meta charset="utf-8"><title>{{ $sale->invoice_no }}</title><style>@page{size:80mm auto;margin:3mm}*{box-sizing:border-box}body{font-family:"DejaVu Sans",Arial,sans-serif;width:74mm;margin:0 auto;font-size:9px;color:#111}.center{text-align:center}.company{font-size:14px;font-weight:bold}.ar{direction:rtl}.line{border-top:1px dashed #777;margin:7px 0}table{width:100%;border-collapse:collapse}th,td{padding:3px 1px;border-bottom:1px dotted #bbb;text-align:left}td:last-child,th:last-child{text-align:right}.totals div{display:flex;justify-content:space-between;padding:2px}.grand{font-size:13px;font-weight:bold;border-top:1px solid #111;margin-top:3px}.qr svg{width:32mm;height:32mm}.toolbar{margin:8px;text-align:center}.toolbar button{padding:8px 14px}@media print{.toolbar{display:none}}</style></head><body><div class="toolbar"><button onclick="print()">Print</button></div><div class="center"><div class="company">{{ $company->company_name_en }}</div><div class="ar">{{ $company->company_name_ar }}</div>@if($sale->invoice_type!=='non_tax_invoice')<div>VAT {{ $company->vat_number }}</div>@endif</div><div class="line"></div><div><b>{{ $sale->invoice_type==='non_tax_invoice'?'INVOICE':($sale->invoice_type==='simplified_tax_invoice'?'SIMPLIFIED TAX INVOICE':'TAX INVOICE') }}</b><br>{{ $sale->invoice_no }} · {{ $sale->invoice_timestamp->format('Y-m-d H:i') }}<br>{{ $sale->customer->name_en }}<div class="ar">{{ $sale->customer->name_ar }}</div></div><div class="line"></div><table><thead><tr><th>Item</th><th>Qty × Price</th><th>Total</th></tr></thead><tbody>@foreach($sale->items as $item)<tr><td>{{ $item->product_name_en_snapshot }}<small class="ar d-block">{{ $item->product_name_ar_snapshot }}</small></td><td>{{ number_format((float)$item->quantity,2) }} × {{ number_format((float)$item->unit_price,2) }}</td><td>{{ number_format((float)$item->line_total,2) }}</td></tr>@endforeach</tbody></table><div class="totals"><div><span>{{ $sale->invoice_type==='non_tax_invoice'?'Subtotal':'Taxable' }}</span><b>{{ number_format((float)$sale->taxable_total,2) }}</b></div>@if($sale->invoice_type!=='non_tax_invoice')<div><span>VAT</span><b>{{ number_format((float)$sale->vat_total,2) }}</b></div>@endif<div class="grand"><span>TOTAL SAR</span><span>{{ number_format((float)$sale->grand_total,2) }}</span></div><div><span>Payment</span><span>{{ ucfirst($sale->payment_type) }}</span></div></div>@if($sale->invoice_type!=='non_tax_invoice')<div class="center qr">{!! $qrSvg !!}</div>@endif<div class="center">Thank you · شكراً لكم</div></body></html>
