@php $party = $party ?? ($payment->isReceived() ? $payment->customer : $payment->vendor); $docOpts = $docSettings['options'] ?? []; $docLbl = $docSettings['labels'] ?? []; $kindMeta = $kindMeta ?? $payment->kindMeta(); $paymentTitle = $paymentTitle ?? $kindMeta['title'] ?? 'PAYMENT'; $amountLabel = $amountLabel ?? $kindMeta['amount_label'] ?? 'Amount'; $forPdf = $forPdf ?? false; if ($forPdf) { $logoImage = $logoPath ?? \App\Helpers\CompanyMedia::pdfImagePath($company->logo_path ?? null); $signatureImage = $signaturePath ?? \App\Helpers\CompanyMedia::pdfImagePath($company->signature_image_path ?? null); } else { $logoImage = $logoPath ?? $logoSrc ?? \App\Helpers\CompanyMedia::imageSource($company->logo_path ?? null); $signatureImage = $signaturePath ?? $signatureSrc ?? \App\Helpers\CompanyMedia::imageSource($company->signature_image_path ?? null); } @endphp
@if($logoImage) @endif

{{ $company->name ?? 'Company' }}

@foreach($company->fullAddressLines() as $line)

{{ $line }}

@endforeach @if($company->phone)

Phone: {{ $company->phone }}

@endif @if($company->email)

Email: {{ $company->email }}

@endif @if($company->gstin)

GSTIN: {{ $company->gstin }}

@endif

{{ $paymentTitle }}

#{{ $payment->payment_number }}

{{ $documentCopyLabel ?? 'Original Copy' }}

{{ $amountLabel }}: ₹ {{ number_format((float) $payment->amount, 2) }}
@if($party)

{{ $party->name }}

@foreach($party->billingAddressLines() as $line)

{{ $line }}

@endforeach @if($party->gstin ?? null)

GSTIN: {{ $party->gstin }}

@endif @endif
@if($payment->transaction_ref) @endif @if((float) $payment->available_credit > 0) @endif
{{ $docLbl['payment_date'] ?? 'Payment Date' }} {{ $payment->payment_date->format('d - M - Y') }}
{{ $docLbl['payment_method'] ?? 'Payment Method' }} {{ $payment->paymentMethodLabel() }}
Reference # {{ $payment->transaction_ref }}
{{ $docLbl['available_credit'] ?? 'Available Credit' }} ₹ {{ number_format((float) $payment->available_credit, 2) }}
@if($payment->allocations->isNotEmpty()) @foreach($payment->allocations as $idx => $alloc) @endforeach
S.No {{ $docLbl['col_document_number'] ?? 'Document Number' }} {{ $docLbl['col_document_date'] ?? 'Document Date' }} {{ $docLbl['col_document_amount'] ?? 'Document Amount (₹)' }} {{ $docLbl['col_payment_amount'] ?? 'Payment Amount (₹)' }}
{{ $idx + 1 }} {{ $alloc->document_number }} {{ $alloc->document_date?->format('d - M - Y') ?? '—' }} {{ number_format((float) $alloc->document_amount, 2) }} {{ number_format((float) $alloc->allocated_amount, 2) }}
@endif
@if(($docOpts['show_primary_signature'] ?? true) && $signatureImage)

{{ $settings['primary_signature_label'] ?? 'Provider Signature' }}

@endif
@if((float) $payment->available_credit > 0) @endif
{{ $paymentTitle }} ₹ {{ number_format((float) $payment->amount, 2) }}
{{ $docLbl['available_credit'] ?? 'Available Credit' }} ₹ {{ number_format((float) $payment->available_credit, 2) }}
@if($docOpts['show_secondary_signature'] ?? false)

{{ $settings['secondary_signature_label'] ?? 'Receiver Signature' }}

@endif
@if(($docOpts['show_total_in_words'] ?? true) && !empty($amountInWords))

Amount in words: {{ $amountInWords }}

@endif @if($payment->notes)

Notes: {{ $payment->notes }}

@endif