Receipt @php $s = fn($k,$d=null) => $settings[$k] ?? $d; $bizName = $s('business_name', config('app.name')); $bizTagline = $s('business_tagline'); $bizPhone = $s('phone'); $bizAddress = $s('address'); $footerMsg = $s('receipt_footer', 'Thank you for your business!'); $logoUrl = $s('logo') ? Storage::url($s('logo')) : null; $prefix = $s('receipt_prefix', 'CW-'); $hasProducts = $sale->items->isNotEmpty(); $hasServices = $enriched->isNotEmpty(); $statusColors = ['completed'=>'#1A6640','partial'=>'#8A6010','pending'=>'#901A1A','cancelled'=>'#7A9ACE']; $statusBg = ['completed'=>'#E6F4EC','partial'=>'#FEF8E7','pending'=>'#FEF0F0','cancelled'=>'#EEF4FC']; $st = $sale->status ?? 'pending'; @endphp
@if($logoUrl) Logo @endif
{{ $bizName }}
@if($bizTagline)
{{ $bizTagline }}
@endif @if($bizAddress)
{{ $bizAddress }}
@endif @if($bizPhone)
Tel: {{ $bizPhone }}
@endif
Receipt
{{ $prefix }}{{ $sale->reference_no }}
{{ $sale->sale_date?->format('d M Y H:i') }}
Client
{{ $sale->client?->full_name ?? 'Walk-in' }}
@if($sale->client?->phone)
{{ $sale->client->phone }}
@endif @if($sale->client?->vehicles?->first())
{{ $sale->client->vehicles->first()->plate_number }}
@endif
Cashier
{{ $sale->cashier?->name ?? 'Staff' }}
Status
{{ ucfirst($st) }}
@if($sale->is_ready)
Vehicle Ready
@endif
Items
@foreach($enriched as $si) @endforeach @foreach($sale->items as $item) @endforeach @if(!$hasServices && !$hasProducts) @endif
Description Staff Qty Unit Price Total
{{ $si['service_name'] }}Service
@if($si['discount_percent'] > 0)
{{ $si['discount_percent'] }}% discount
@endif
{{ $si['staff_name'] ?? '—' }}
{{ $si['quantity'] }} KSh {{ number_format($si['selling_price'], 2) }} KSh {{ number_format($si['line_total'], 2) }}
{{ $item->product?->name ?? 'Product' }}Product
@if($item->product?->sku)
SKU: {{ $item->product->sku }}
@endif
{{ $item->quantity }} KSh {{ number_format($item->selling_price ?? 0, 2) }} KSh {{ number_format($item->line_total ?? 0, 2) }}
No items recorded
SubtotalKSh {{ number_format($sale->subtotal ?? 0, 2) }}
@if($sale->discount_total > 0)
Discount- KSh {{ number_format($sale->discount_total, 2) }}
@endif
Grand TotalKSh {{ number_format($sale->total ?? 0, 2) }}
@if($sale->total_paid > 0) @endif @if($sale->remaining_balance > 0)
Balance DueKSh {{ number_format($sale->remaining_balance, 2) }}
@endif
Payment Details
@forelse($sale->payments ?? [] as $pmt)
{{ ucfirst($pmt['method'] ?? 'Payment') }}
@if(!empty($pmt['transaction_no']))
Ref: {{ $pmt['transaction_no'] }}
@endif @if(!empty($pmt['paid_at']))
{{ \Carbon\Carbon::parse($pmt['paid_at'])->format('d M Y H:i') }}
@endif
KSh {{ number_format($pmt['amount'] ?? 0, 2) }}
@empty
No payments recorded
@endforelse @if($sale->remaining_balance > 0)
Balance Due: KSh {{ number_format($sale->remaining_balance, 2) }}
@else
Fully Paid
@endif @if($sale->is_ready) @endif
@push('scripts') @endpush