@php $cur = $shop->currency; $n = fn ($v) => number_format((float) $v, 2); $m = fn ($v) => number_format((float) $v, 2).' '.$cur; $q = fn ($v) => rtrim(rtrim(number_format((float) $v, 3, '.', ''), '0'), '.'); $local = $sale->sold_at->copy()->timezone($shop->timezone); $methods = ['cash' => 'Cash', 'card' => 'Card', 'mobile' => 'Mobile banking']; $due = $sale->due_amount; $cols = 5 + ($showDiscount ? 1 : 0) + ($showTax ? 1 : 0); $sheetWidth = ['a4' => '182mm', 'letter' => '188mm', 'a5' => '120mm'][$paper] ?? '182mm'; $stampColors = ['paid' => '#0a7a0a', 'partial' => '#b45309', 'unpaid' => '#b91c1c', 'void' => '#6b7280']; @endphp {{ $sale->invoice_no }}
@if ($logo)
@endif
{{ $shop->name }}
@if ($shop->address){{ $shop->address }}@endif
@if ($shop->phone)Tel {{ $shop->phone }}@endif @if ($shop->phone && $shop->email)  ·  @endif @if ($shop->email){{ $shop->email }}@endif
@if ($taxNumber)
Tax no. {{ $taxNumber }}
@endif
{{ strtoupper($title) }}
@if ($sale->user)@endif
Invoice no.{{ $sale->invoice_no }}
Date{{ $local->format('d M Y') }}
Time{{ $local->format('H:i') }}
Served by{{ $sale->user->name }}
{{ $state['label'] }}
Bill to
@if ($sale->customer) {{ $sale->customer->name }} @if ($sale->customer->address)
{{ $sale->customer->address }}
@endif @if ($sale->customer->phone)
Tel {{ $sale->customer->phone }}
@endif @if ($sale->customer->email)
{{ $sale->customer->email }}
@endif @else Walk-in customer @endif
Payment
@forelse ($sale->payments as $p)
{{ $methods[$p->method] ?? ucfirst($p->method) }}: {{ $m($p->amount) }}
@empty
No payment received yet
@endforelse @if ((float) $sale->change_given > 0)
Change given: {{ $m($sale->change_given) }}
@endif
@if ($showDiscount)@endif @if ($showTax)@endif @foreach ($sale->items as $i => $item) @if ($showDiscount)@endif @if ($showTax)@endif @endforeach
# Description Qty Unit priceDiscountTaxAmount ({{ $cur }})
{{ $i + 1 }} {{ $item->product_name }} @if ($item->sku)
SKU {{ $item->sku }}
@endif @if ((float) $item->returned_quantity > 0)
{{ $q($item->returned_quantity) }} returned
@endif
{{ $q($item->quantity) }}@if ($item->product?->unit) {{ $item->product->unit }}@endif {{ $n($item->unit_price) }}{{ (float) $item->discount > 0 ? '−'.$n($item->discount) : '' }}{{ (float) $item->tax > 0 ? $n($item->tax) : '' }}{{ $n($item->total) }}
@if ($inWords)
Amount in words
{{ $inWords }}
@endif @if ($sale->notes)
Notes
{{ $sale->notes }}
@endif @if ($sale->returns->isNotEmpty())
Credit notes issued
@foreach ($sale->returns as $r)
{{ $r->return_no }} · {{ $r->returned_at->copy()->timezone($shop->timezone)->format('d M Y') }} · −{{ $m($r->total) }}
@endforeach @endif
@if ($showDiscount)@endif @if ($showTax)@endif @if ((float) $sale->returned_amount > 0)@endif @if ((float) $sale->refunded_amount > 0)@endif @if ((float) $due > 0)@endif
Subtotal{{ $m($sale->subtotal) }}
Discount−{{ $m($sale->discount) }}
Tax{{ $m($sale->tax) }}
TOTAL{{ $m($sale->total) }}
Returned−{{ $m($sale->returned_amount) }}
Paid{{ $m($sale->paid_amount) }}
Refunded−{{ $m($sale->refunded_amount) }}
BALANCE DUE{{ $m($due) }}
@if ($terms || $bank) @if ($terms)@endif @if ($bank)@endif
Terms & conditions
{{ $terms }}
Payment details
{{ $bank }}
@endif @if ($footer)

{{ $footer }}

@endif @if (! $isPdf)
Open PDF Download PDF
@if ($autoPrint)@endif @endif
@if ($isPdf) @endif