@php $fmt = fn ($v) => number_format((float) $v, 2) . ' ' . $shop->currency; $change = $sale->change_given; @endphp {{ $sale->invoice_no }} @if ($logo)@endif

{{ $shop->name }}

@if ($shop->address){{ $shop->address }}
@endif @if ($shop->phone)Tel: {{ $shop->phone }}
@endif @if ($taxNumber)Tax no: {{ $taxNumber }}@endif

@if ($sale->user)@endif
Invoice{{ $sale->invoice_no }}
Date{{ $sale->sold_at->timezone($shop->timezone)->format('Y-m-d H:i') }}
Served by{{ $sale->user->name }}
Customer{{ $sale->customer?->name ?? 'Walk-in' }}

@foreach ($sale->items as $i) @endforeach
ItemQtyPriceTotal
{{ $i->product_name }} @if ((float) $i->discount > 0)
discount -{{ number_format((float) $i->discount, 2) }}@endif
{{ rtrim(rtrim(number_format((float) $i->quantity, 3, '.', ''), '0'), '.') }} {{ number_format((float) $i->unit_price, 2) }} {{ number_format((float) $i->total, 2) }}
@if ((float) $sale->discount > 0)@endif @if ((float) $sale->tax > 0)@endif
Subtotal{{ $fmt($sale->subtotal) }}
Discount-{{ $fmt($sale->discount) }}
Tax{{ $fmt($sale->tax) }}
TOTAL{{ $fmt($sale->total) }}

@foreach ($sale->payments as $p) @endforeach @if ((float) $change > 0)@endif @if ((float) $sale->due_amount > 0) @if ($sale->customer)@endif @endif
{{ $p->method }}@if ($p->tendered !== null) (tendered {{ number_format((float) $p->tendered, 2) }})@endif{{ $fmt($p->amount) }}
Change{{ $fmt($change) }}
ON CREDIT{{ $fmt($sale->due_amount) }}
Account balance{{ $fmt($sale->customer->balance) }}
@if ($sale->notes)
{{ $sale->notes }}
@endif @if ($footer)
{{ $footer }}
@endif

Thank you!

@if (! $pdf)
PDF
@if ($autoPrint)@endif @endif