@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
|
@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) }}
{{ $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
|
| # | Description | Qty | Unit price | @if ($showDiscount)Discount | @endif @if ($showTax)Tax | @endifAmount ({{ $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) }} | @if ($showDiscount){{ (float) $item->discount > 0 ? '−'.$n($item->discount) : '' }} | @endif @if ($showTax){{ (float) $item->tax > 0 ? $n($item->tax) : '' }} | @endif{{ $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
|
|
Terms & conditions {{ $terms }} | @endif
@if ($bank)Payment details {{ $bank }} | @endif
{{ $footer }}
@endif @if (! $isPdf) @if ($autoPrint)@endif @endif