@php $receiptSettings = $receiptSettings ?? []; $isSinhala = in_array(($lang ?? 'default'), ['sinhala', 'si', 1, '1'], true); $label = function (string $en) use ($isSinhala) { return $isSinhala ? ('* ' . $en) : $en; }; $customer = $payment->customer; $logs = $payment->logs ?? collect(); $logoPos = (float) ($location->logo_width_pos ?? 95); $logoA4 = (float) ($location->logo_width_a4 ?? 40); @endphp
{{-- Logo --}} @if(($receiptSettings['receipt_show_logo'] ?? 1) && $location && $location->logo)
Logo
@endif {{-- Business Header --}}
{{ $receiptSettings['business_name'] ?? config('app.name', 'POS System') }}
@if(!empty($receiptSettings['business_address'] ?? null))
{{ $receiptSettings['business_address'] }}
@endif @if(!empty($receiptSettings['business_phone'] ?? null))
{{ $receiptSettings['business_phone'] }}
@endif
{{ $label('Customer Balance Payment Receipt') }}
@if(!empty($customer->pin)) @endif @if(!empty($customer->mobile)) @endif
{{ $label('Date') }} {{ $payment->applied_at ? $payment->applied_at->format('Y-m-d h:i A') : now()->format('Y-m-d h:i A') }}
{{ $label('Customer') }} {{ $customer->name ?? '-' }}
{{ $label('PIN') }} {{ $customer->pin }}
{{ $label('Mobile') }} {{ $customer->mobile }}
{{ $label('Payment Method') }} {{ strtoupper($payment->channel ?? 'cash') }}
{{ $label('Previous Due') }} {{ number_format((float) ($payment->balance_before ?? 0), 2) }}
{{ $label('Paid Now') }} {{ number_format((float) ($payment->amount_applied ?? 0), 2) }}
{{ $label('Current Due') }} {{ number_format((float) ($payment->balance_after ?? 0), 2) }}
{{ $label('Allocations') }}
@foreach($logs as $log) @endforeach
{{ $label('Invoice') }} {{ $label('Due Before') }} {{ $label('Paid') }} {{ $label('Due After') }}
{{ $log->invoice->invoice_number ?? ($log->invoice_id ?? '-') }} @if($log->invoice && $log->invoice->posted_at)
{{ $log->invoice->posted_at->format('Y-m-d') }}
@endif
{{ number_format((float) ($log->due_before ?? 0), 2) }} {{ number_format((float) ($log->amount ?? 0), 2) }} {{ number_format((float) ($log->due_after ?? 0), 2) }}
{{ $label('Thank you!') }}