From 851d76460ab122768a0c7dcbfe4d42ca14f9ce70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Aug 2019 17:42:25 +0200 Subject: [PATCH] FIX #11720 --- htdocs/takepos/invoice.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 1682db54468..1729e22427c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -139,9 +139,14 @@ if ($action == 'valid' && $user->rights->facture->creer) $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; if (! empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") { + $savconst = $conf->global->STOCK_CALCULATE_ON_BILL; + $conf->global->STOCK_CALCULATE_ON_BILL=1; + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; - dol_syslog("Validate invoice with stock change into warehouse id ".$constantforkey); + dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".$conf->global->$constantforkey); $invoice->validate($user, '', $conf->global->$constantforkey); + + $conf->global->STOCK_CALCULATE_ON_BILL = $savconst; } else {