Invoice No:
{{ $data['invoice_no'] ?? '' }}
Receipt No:
{{ $data['receipt_no'] ?? '' }}
Date:
{{ $data['date'] ?? '' }} {{ $data['time'] ?? '' }}
Cashier:
{{ $data['cashier'] ?? 'Cashier' }}
{{-- Customer Information --}}
@if($customerName)
Customer:
{{ $customerName }}
@endif
@if($customerPhone)
Phone:
{{ $customerPhone }}
@endif
@if($customerVatNumber)
VAT No:
{{ $customerVatNumber }}
@endif
@if($customerVatStatus && in_array($customerVatStatus, ['exempted', 'zero_rated']))
VAT Status:
{{
$customerVatStatus === 'exempted' ? 'VAT Exempted' :
($customerVatStatus === 'zero_rated' ? 'Zero-Rated' : 'VATable')
}}
@endif
@if(!$customerName)
Customer:
Walk-in Customer
@endif
ITEMS
@if(count($items) > 0)
@foreach($items as $item)
@php
$itemName = $item['name'] ?? 'Item';
$itemQty = $item['quantity'] ?? $item['qty'] ?? 1;
$itemPrice = $item['unit_price'] ?? $item['price'] ?? 0;
$itemTotal = $item['total'] ?? ($itemPrice * $itemQty);
$itemTaxRate = $item['tax_rate'] ?? 0;
$itemTaxAmount = $item['tax_amount'] ?? 0;
$isVatable = $item['is_vatable'] ?? ($itemTaxRate > 0);
@endphp
{{ $itemName }}
{{ $itemQty }}
KES {{ number_format($itemPrice, 2) }}
KES {{ number_format($itemTotal, 2) }}
@if($isVatable && $itemTaxRate > 0 && $itemTaxAmount > 0)
VAT {{ $itemTaxRate }}%
KES {{ number_format($itemTaxAmount, 2) }}
@endif
@endforeach
@else
@endif
TOTALS
Subtotal:
KES {{ number_format($subtotal, 2) }}
@if($discount > 0)
Discount:
-KES {{ number_format($discount, 2) }}
@endif
@if(count($vatBreakdown) > 0)
@foreach($vatBreakdown as $vat)
VAT {{ $vat['rate'] ?? 16 }}%:
KES {{ number_format($vat['amount'] ?? 0, 2) }}
@endforeach
@elseif($vatAmount > 0)
VAT:
KES {{ number_format($vatAmount, 2) }}
@endif
@if($taxableAmount > 0)
Taxable Amount:
KES {{ number_format($taxableAmount, 2) }}
@endif
@if($nonTaxableAmount > 0)
Non-taxable:
KES {{ number_format($nonTaxableAmount, 2) }}
@endif
@if($exemptedAmount > 0)
Exempted:
KES {{ number_format($exemptedAmount, 2) }}
@endif
@if($zeroRatedAmount > 0)
Zero-rated:
KES {{ number_format($zeroRatedAmount, 2) }}
@endif
TOTAL:
KES {{ number_format($grandTotal, 2) }}
PAYMENT
{{ strtoupper($paymentMethod) }}
Amount Paid: KES {{ number_format($amountPaid, 2) }}
@if($paymentMethod === 'cash' && $cashReceived)
Cash Received: KES {{ number_format($cashReceived, 2) }}
@endif
@if($paymentMethod === 'cash' && $change > 0)
Change: KES {{ number_format($change, 2) }}
@endif
@if($paymentMethod === 'mpesa' && $mpesaDetails)
Phone: {{ $mpesaDetails['phone'] ?? '' }}
Transaction ID: {{ $mpesaDetails['transaction_id'] ?? '' }}
@endif
@if($transactionId)
Transaction ID: {{ $transactionId }}
@endif
@if($isExempted || $isZeroRated || !$isVatApplicable)
VAT INFORMATION
@if($isExempted)
VAT EXEMPTED CUSTOMER
No VAT Applied
@elseif($isZeroRated)
ZERO-RATED CUSTOMER
0% VAT Rate Applied
@elseif(!$isVatApplicable)
NO VAT APPLICABLE
VAT Not Applied
@endif
@endif