@php $date_format = session('business.date_format') ?? 'd/m/Y'; $time_format = session('business.time_format') ?? '12'; $name = session('business.name') ?? 'Business Name'; $location = session('business.location') ?? ''; $contact = session('business.contact') ?? ''; // Get balance data $received = $single_payment_line->amount ?? 0; // Use the due balance calculated in controller (same as classic.blade.php) // Current balance is the due amount after this payment $current_balance = $due ?? 0; // Previous balance = current balance + received amount $previous_balance = $current_balance + $received; @endphp
@if(!empty(Session::get('business.logo'))) Logo @endif
{{ strtoupper($name) }}
@if(!empty($location))
{{ $location }}
@endif @if(!empty($contact))
{{ $contact }}
@endif
Payment Receipt
{{ $transaction->contact->name ?? $contact->name ?? 'Customer' }} Date:{{ \Carbon\Carbon::now()->format('d/m/Y') }}
{{ $transaction->contact->mobile ?? '' }} Time:{{ \Carbon\Carbon::now()->format($time_format === '12' ? 'h:i A' : 'H:i') }}
Receipt No: {{ $single_payment_line->payment_ref_no }}
Received : {{ number_format($received, 2) }}
Previous Bal : {{ number_format($previous_balance, 2) }}
Current Bal : {{ number_format($current_balance, 2) }}
Payment Method: {{ ucfirst($single_payment_line->method ?? 'cash') }}
Paid To: {{ ucwords(\Illuminate\Support\Facades\Auth::user()->username ?? 'Admin') }}