From 95be3976c4ad12a4209793e7de405bc8085a64cf Mon Sep 17 00:00:00 2001 From: IJ Date: Thu, 29 Nov 2018 22:37:07 +0000 Subject: [PATCH] NEW: Add Autofill Remainder Amount to Expense Report Payment Page --- htdocs/expensereport/payment/payment.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index 046bb522ae2..a4346ce34bc 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -187,6 +187,20 @@ if ($action == 'create' || empty($action)) $total = $expensereport->total_ttc; + // autofill remainder amount + if (! empty($conf->use_javascript_ajax)) + { + print "\n".''."\n"; + } + print load_fiche_titre($langs->trans("DoPayment")); print '
'; @@ -298,7 +312,12 @@ if ($action == 'create' || empty($action)) if ($sumpaid < $objp->total_ttc) { $namef = "amount_".$objp->id; - print ''; + $nameRemain = "remain_".$objp->id; // autofill remainder amount + if (!empty($conf->use_javascript_ajax)) // autofill remainder amount + print img_picto("Auto fill",'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->total_ttc - $sumpaid)."'"); // autofill remainder amount + $remaintopay=$objp->total_ttc - $sumpaid; // autofill remainder amount + print ''; // autofill remainder amount + print ''; } else {