From 851d76460ab122768a0c7dcbfe4d42ca14f9ce70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Aug 2019 17:42:25 +0200 Subject: [PATCH 1/3] 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 { From e09223ed4d3ebc9f4001d22660d60852598cf160 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Aug 2019 17:52:46 +0200 Subject: [PATCH 2/3] FIX #11702 --- htdocs/core/tpl/objectline_create.tpl.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 75c6f72e1df..f427bb34f92 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -110,7 +110,9 @@ if ($nolinesbefore) { { ?> trans('SupplierRef'); ?> - + trans('VAT'); ?> trans('PriceUHT'); ?> multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?> @@ -249,11 +251,11 @@ if ($nolinesbefore) { if (! empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, -1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); } else { - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, '', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, -1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, '', GETPOST('combinations', 'array')); } if (! empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_CUSTOMER_PRODUCTS)) From 529c2f4992bd3f8ee6a1906a824a988f3ad1976d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Aug 2019 17:54:51 +0200 Subject: [PATCH 3/3] Fix phpcs --- test/phpunit/FunctionsLibTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 2a7734716eb..1081b3bba23 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -1280,5 +1280,4 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase return true; } - }