Prefill Amount field with latest invoice pending value

Just a MOD to display the amount from the latest invoice in index.php/payments/form

Look for input type=“text” name=“payment_amount” id=“payment_amount” class=“form-control” then modify with this:

<input type="text" name="payment_amount" id="payment_amount" class="form-control"
                       value="<?php  $i = 0;
					$len = count($open_invoices);
					foreach ($open_invoices as $invoice) { 					  
 if ($i == 0) { ?><?php echo $invoice->invoice_balance; ?><?php } 
					    $i++;
						} ?>">

1 Like