From 2cfc62d753785654dd99a9a4973903e888f9df0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Feb 2020 00:11:13 +0100 Subject: [PATCH] Update invoice.php --- htdocs/takepos/invoice.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 68a8dd10fdb..6a919054ee0 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -167,8 +167,13 @@ if ($action == 'valid' && $user->rights->facture->creer) $invoice->fk_facture_source = $fk_source; $invoice->update($user); } - - if ($conf->global->TAKEPOS_NUMBERING_PREFIX) $conf->global->FACTURE_ADDON = $conf->global->TAKEPOS_NUMBERING_PREFIX; + + $sav_FACTURE_ADDON=''; + if (! empty($conf->global->TAKEPOS_ADDON)) + { + $sav_FACTURE_ADDON = $conf->global->FACTURE_ADDON; + $conf->global->FACTURE_ADDON = $conf->global->TAKEPOS_ADDON; + } $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; if ($invoice->statut != Facture::STATUS_DRAFT) @@ -206,6 +211,12 @@ if ($action == 'valid' && $user->rights->facture->creer) $res = $invoice->validate($user); } + // Restore save values + if (! empty($sav_FACTURE_ADDON)) + { + $conf->global->FACTURE_ADDON = $sav_FACTURE_ADDON; + } + $remaintopay = $invoice->getRemainToPay(); // Add the payment