@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)
@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') }}
| {{ $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 ?? '-' }} |
@if(!empty($customer->pin))
| {{ $label('PIN') }} |
{{ $customer->pin }} |
@endif
@if(!empty($customer->mobile))
| {{ $label('Mobile') }} |
{{ $customer->mobile }} |
@endif
| {{ $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') }}
| {{ $label('Invoice') }} |
{{ $label('Due Before') }} |
{{ $label('Paid') }} |
{{ $label('Due After') }} |
@foreach($logs as $log)
|
{{ $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) }} |
@endforeach
{{ $label('Thank you!') }}