From eb1d57226f45de3f1934845d220880b633cb477d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Mar 2019 20:28:02 +0100 Subject: [PATCH] Fix status paid after entering a payment --- htdocs/takepos/invoice.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3c39b7e1e4e..0a748ee32d8 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -116,9 +116,16 @@ if ($action == 'valid' && $user->rights->facture->creer) $payment->create($user); $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); - if ($invoice->getRemainToPay() == 0) + $remaintopay = $invoice->getRemainToPay(); + if ($remaintopay == 0) { + dol_syslog("Invoice is paid, so we set it to pay"); $result = $invoice->set_paid($user); + if ($result > 0) $invoice->paye = 1; + } + else + { + dol_syslog("Invoice is not paid, remain to pay = ".$remaintopay); } }