From 4cea0433b7baa2edf41c3ca4c5bfa04b362105a5 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Fri, 16 Aug 2019 23:33:48 +0200 Subject: [PATCH] If user has not used change control, add total invoice payment --- htdocs/takepos/invoice.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index dfa058068ad..17805a6b060 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -175,6 +175,9 @@ if ($action == 'valid' && $user->rights->facture->creer) $payment->datepaye = $now; $payment->fk_account = $bankaccount; $payment->amounts[$invoice->id] = $amountofpayment; + + // If user has not used change control, add total invoice payment + if ($amountofpayment == 0) $payment->amounts[$invoice->id] = $invoice->total_ttc; $payment->paiementid=$paiementid; $payment->num_payment=$invoice->ref;