From dcb7958be9ee104be290711f16d0cf6fee133d60 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Sat, 13 Mar 2021 08:44:16 +0100 Subject: [PATCH 1/3] Update list.php Changed the presentation of the stock to show decimals and thousands separator. changes price2num to price and use MAIN_MAX_DECIMALS_STOCK --- htdocs/product/list.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 5bc973e56b7..3d471ff314f 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1643,7 +1643,9 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - print price2num($product_static->stock_reel, 'MS'); + $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; + print price($product_static->stock_reel, 0, $langs->defaultlang,1,-1,$decimals); + //print price2num($product_static->stock_reel, 'MS'); } print ''; if (!$i) { @@ -1657,7 +1659,9 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - print price2num($product_static->stock_theorique, 'MS'); + $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; + print price($product_static->stock_theorique, 0, $langs->defaultlang,1,-1,$decimals); + //print price2num($product_static->stock_theorique, 'MS'); } print ''; if (!$i) { From f68bbdcf45d6754e1c381e69983dc9ccb9274163 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 13 Mar 2021 07:46:46 +0000 Subject: [PATCH 2/3] Fixing style errors. --- htdocs/product/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 3d471ff314f..bae9fe991d3 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1644,7 +1644,7 @@ if ($resql) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; - print price($product_static->stock_reel, 0, $langs->defaultlang,1,-1,$decimals); + print price($product_static->stock_reel, 0, $langs->defaultlang, 1, -1, $decimals); //print price2num($product_static->stock_reel, 'MS'); } print ''; @@ -1660,7 +1660,7 @@ if ($resql) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; - print price($product_static->stock_theorique, 0, $langs->defaultlang,1,-1,$decimals); + print price($product_static->stock_theorique, 0, $langs->defaultlang, 1, -1, $decimals); //print price2num($product_static->stock_theorique, 'MS'); } print ''; From ba4fd3d44f66b4f196e1f990d1c7b2702eb470b7 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Mon, 15 Mar 2021 13:44:40 +0100 Subject: [PATCH 3/3] Update list.php --- htdocs/product/list.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index bae9fe991d3..36c2de9e3ba 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1643,9 +1643,7 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; - print price($product_static->stock_reel, 0, $langs->defaultlang, 1, -1, $decimals); - //print price2num($product_static->stock_reel, 'MS'); + print price(price2num($product_static->stock_reel, 'MS')); } print ''; if (!$i) { @@ -1659,9 +1657,7 @@ if ($resql) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) { print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - $decimals = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK; - print price($product_static->stock_theorique, 0, $langs->defaultlang, 1, -1, $decimals); - //print price2num($product_static->stock_theorique, 'MS'); + print price(price2num($product_static->stock_theorique, 'MS')); } print ''; if (!$i) {