From 2af9904c047ae4c244057e72053cb7dd15c688cd Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 7 Mar 2020 22:56:43 +0100 Subject: [PATCH] Avoid higher payments than remain in TakePOS --- htdocs/takepos/invoice.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index e4ad387e1cc..4660032cc15 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -226,7 +226,8 @@ if ($action == 'valid' && $user->rights->facture->creer) $payment->amounts[$invoice->id] = $amountofpayment; // If user has not used change control, add total invoice payment - if ($amountofpayment == 0) $payment->amounts[$invoice->id] = $remaintopay; + // Or if user has used change control and the amount of payment is higher than remain to pay, add the remain to pay + if ($amountofpayment == 0 || $amountofpayment>$remaintopay) $payment->amounts[$invoice->id] = $remaintopay; $payment->paiementid = $paiementid; $payment->num_payment = $invoice->ref;