From 5873d41f647e267d96ffa8b8dd541779bc992ad7 Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Fri, 13 Mar 2020 11:51:18 +0100 Subject: [PATCH 01/17] Fix: DEFAULT_WAREHOUSE to define default in warehouse selections --- htdocs/product/stock/tpl/stockcorrection.tpl.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 6d63d258c9c..a1d7af8a74a 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -70,7 +70,9 @@ if ($object->element == 'product') { print ''.$langs->trans("Warehouse").''; print ''; - print $formproduct->selectWarehouses((GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); + $ident=(GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))); +if(empty($ident)&&!empty($conf->global->DEFAULT_WAREHOUSE))$ident=$conf->global->DEFAULT_WAREHOUSE; + print $formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); print '   '; print ''; From 819984cfe098d57a03c355f84d9857f520da2c8e Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Sun, 31 May 2020 00:43:05 +0100 Subject: [PATCH 03/17] replace with better normalized constant --- htdocs/product/stock/tpl/stockcorrection.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index cce3868b0e8..fdff86bf810 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -71,7 +71,7 @@ if ($object->element == 'product') print ''.$langs->trans("Warehouse").''; print ''; $ident=(GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))); - if (empty($ident)&&!empty($conf->global->DEFAULT_WAREHOUSE))$ident=$conf->global->DEFAULT_WAREHOUSE; + if (empty($ident)&&!empty($conf->global->MAIN_DEFAULT_WAREHOUSE))$ident=$conf->global->MAIN_DEFAULT_WAREHOUSE; print $formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); print '   '; print '';