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;