@extends('pdf._base') @section('title', 'Receipt '.($payment->receipt_no ?: $payment->id)) @php $allocs = $payment->allocations->where('reversed', false); $plan = $invoice?->paymentPlan; $next = $plan?->nextInstallment(); $refunded = $payment->status === 'refunded'; @endphp @section('body') @include('pdf._letterhead', ['title' => 'PAYMENT RECEIPT', 'number' => $payment->receipt_no ?: $payment->reference, 'subtitle' => 'Official receipt']) @if($refunded)
REFUNDED
@endif
@include('pdf._from')
Received from
{{ $payment->user?->name ?? $invoice?->customer_name }}
{{ $payment->user?->email ?? $invoice?->customer_email }}@if($payment->user?->student_code)
Student ID {{ $payment->user->student_code }}@endif
@if($payment->transaction_ref)@endif @if($invoice)@endif
Receipt no.{{ $payment->receipt_no ?: '—' }}
Payment date{{ ($payment->paid_at ?? $payment->created_at)->format('d M Y') }}
Method{{ ucfirst(str_replace('_', ' ', (string) $payment->method)) }}
Transaction ID{{ $payment->transaction_ref }}
Against invoice{{ $invoice->number }}
Amount received
{{ money2($payment->amount) }}
{{ amount_in_words($payment->amount, $payment->currency) }}
@if($invoice)
Balance after this payment
{{ money2($payment->balanceAfter()) }}
@endif
{{ $payment->status === 'paid' ? 'Payment verified' : $payment->status }}
Received for
@if($allocs->isNotEmpty()) @foreach($allocs->values() as $n => $a) @endforeach @elseif($invoice) @foreach($invoice->items->take(6) as $n => $it) @endforeach @endif
DescriptionAmount
{{ $a->installment->label }} · due {{ $a->installment->due_date->format('d M Y') }}{{ $plan ? ' · plan '.$plan->code : '' }}{{ money2($a->amount) }}
{{ $it->description }}{{ $n === 0 ? money2($payment->amount) : '' }}
@if($invoice)
@if($next)
Next installment
{{ money2($next->outstanding()) }} due {{ $next->due_date->format('d M Y') }}
{{ $next->label }} · plan {{ $plan->code }}
@elseif($payment->balanceAfter() <= 0)
Fully paid — thank you!
No balance remains on invoice {{ $invoice->number }}.
@endif
Invoice total{{ money2($invoice->total) }}
This payment{{ money2($payment->amount) }}
Balance remaining{{ money2($payment->balanceAfter()) }}
@endif
This receipt confirms that {{ config('infotics.brand.legal_name') }} received the amount above. Please keep it for your records. Fees are subject to the INFOTICS refund policy.@if($payment->receiver)
Recorded by {{ $payment->receiver->name }} on {{ ($payment->paid_at ?? $payment->created_at)->format('d M Y, h:i A') }}.@endif
Accounts Department · {{ $brand['name'] }}
@if($payment->receipt_no) @include('pdf._verify', ['qr' => $qr, 'verifyUrl' => $verifyUrl, 'docId' => $payment->receipt_no, 'docType' => 'receipt', 'hint' => 'Scan to confirm this receipt is genuine and see the payment record.']) @endif
@include('pdf._footer', ['note' => 'Computer-generated receipt — valid without signature.']) @endsection