{{-- Show Previous Pending Warning if exists --}} @php $previousPending = isset($previous_pending_invoice) ? $previous_pending_invoice : null; @endphp @if($previousPending)

Previous Invoice Pending

Invoice #{{ $previousPending->invoice_number }} has pending balance of ₹{{ number_format($previous_pending_amount, 2) }}.

You must clear the previous invoice before receiving payment for this invoice.

@else {{-- Normal payment form here --}} @endif
@csrf

Invoice #{{ $invoice->invoice_number }}

Base Amount: ₹{{ number_format($invoice->base_amount, 2) }}
@if($invoice->discount_amount > 0)
Discount: -₹{{ number_format($invoice->discount_amount, 2) }}
@endif @if($invoice->gst_amount > 0)
GST (18%): ₹{{ number_format($invoice->gst_amount, 2) }}
@endif {{-- Show Previous Balance if exists --}} @if($invoice->previous_balance > 0)
Previous Balance: ₹{{ number_format($invoice->previous_balance, 2) }}
@endif {{-- Show Credit Applied if exists --}} @if($invoice->credit_applied > 0)
Credit Applied: -₹{{ number_format($invoice->credit_applied, 2) }}
@endif
This Invoice Total: ₹{{ number_format($invoice->total_amount, 2) }}
Amount Remaining: ₹{{ number_format(abs($remaining_amount), 2) }} @if($remaining_amount <= 0) (Fully Paid) @endif
@if($remaining_amount > 0)
₹

Invoice total: ₹{{ number_format($invoice->total_amount, 2) }} | Already paid: ₹{{ number_format($total_paid, 2) }} | Remaining: ₹{{ number_format($remaining_amount, 2) }}

@else

Invoice Fully Paid

All payments have been received.

@endif