{{ $settings['business_name'] ?? config('app.name') }}
{{ $settings['business_tagline'] ?? 'Car Wash Services' }}
{{-- Reference --}}
{{ $sale->reference_no }}
@if($sale->client)
{{ $sale->client->full_name }}
@endif
{{ $sale->sale_date->format('d M Y H:i') }}
{{-- Services --}} @if($services->isNotEmpty())
Services
@foreach($services as $svc)
{{ $svc['name'] }}
@if(!empty($svc['staff_name']))
by {{ $svc['staff_name'] }}
@endif
KSh {{ number_format($svc['amount'], 2) }}
@endforeach
@endif {{-- Totals --}}
SubtotalKSh {{ number_format($sale->subtotal, 2) }}
@if($sale->discount_total > 0)
Discount- KSh {{ number_format($sale->discount_total, 2) }}
@endif
Grand TotalKSh {{ number_format($sale->total, 2) }}
@if($sale->total_paid > 0) @endif
@if($sale->remaining_balance > 0)
Balance Due
KSh {{ number_format($sale->remaining_balance, 2) }}
@php $balance = $sale->remaining_balance; $methods = $paymentMethods ?? []; // If no methods configured, show defaults if (empty($methods)) { $methods = [ ['key' => 'mpesa', 'label' => 'M-Pesa', 'type' => 'mpesa', 'enabled' => true], ['key' => 'cash', 'label' => 'Cash', 'type' => 'cash', 'enabled' => true], ]; } $payheroOn = $payheroConfigured ?? false; @endphp
{{-- Method tabs --}} @if(count($methods) > 1)
@foreach($methods as $i => $method) @php $type = strtolower($method['type'] ?? $method['key'] ?? ''); $icon = match(true) { str_contains($type, 'mpesa') || str_contains($type, 'm-pesa') => '📱', str_contains($type, 'cash') => '💵', str_contains($type, 'card') => '💳', default => '💰', }; @endphp
{{ $icon }} {{ $method['label'] }}
@endforeach
@endif {{-- Method panels --}} @foreach($methods as $i => $method) @php $type = strtolower($method['type'] ?? $method['key'] ?? ''); $isMpesa = str_contains($type, 'mpesa') || str_contains($type, 'm-pesa'); $isCash = str_contains($type, 'cash'); $isCard = str_contains($type, 'card'); $key = $method['key']; @endphp
@if($isMpesa && $payheroOn) {{-- M-Pesa with STK Push --}}
Enter the M-Pesa number to receive a payment prompt on the phone.
The number registered with M-Pesa
@elseif($isMpesa && !$payheroOn) {{-- M-Pesa manual (no PayHero) --}}
Enter the M-Pesa transaction code after paying manually.
The code from the M-Pesa confirmation SMS
@elseif($isCash) {{-- Cash --}}
Enter the exact amount received from the customer
@elseif($isCard) {{-- Card --}}
@else {{-- Generic manual --}}
@endif
@endforeach
@else @endif