From d4d3e28437d05a8fab8c7df46211aad57b2885fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Aug 2019 15:53:03 +0200 Subject: [PATCH] It is diffcult to understand how stock decrease is done so we show the ref of stock. --- htdocs/takepos/invoice.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 9616085f6fb..1682db54468 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -136,11 +136,12 @@ if ($action == 'valid' && $user->rights->facture->creer) $invoice->update($user); } - if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1") + $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; + if (! empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") { $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; dol_syslog("Validate invoice with stock change into warehouse id ".$constantforkey); - $invoice->validate($user, '', $conf->global->$cosntantforkey); + $invoice->validate($user, '', $conf->global->$constantforkey); } else { @@ -593,8 +594,17 @@ if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takep $soc = new Societe($db); if ($invoice->socid > 0) $soc->fetch($invoice->socid); else $soc->fetch($conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}); - print '

'; + print '

'; print $langs->trans("Customer").': '.$soc->name; + + $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; + if (! empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") + { + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; + $warehouse = new Entrepot($db); + $warehouse->fetch($conf->global->$constantforkey); + print '
'.$langs->trans("Warehouse").': '.$warehouse->ref; + } print '

'; }