From 368f5e57a97c7ad9686453217e957ab564bd009c Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 2 Oct 2022 20:03:42 +0200 Subject: [PATCH 1/2] Add a global constant to allow a negative quantity in propal's line --- htdocs/comm/propal/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c737ea63ebe..dfe6cae29d2 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -874,7 +874,8 @@ if (empty($reshook)) { } } - if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { + $propal_qty_requirement = (!empty($conf->global->PROPAL_ENABLE_NEGATIVE_QTY) ? ($qty >= 0 || $qty <= 0) : $qty >= 0); + if (!$error && $propal_qty_requirement && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { $pu_ht = 0; $pu_ttc = 0; $price_min = 0; From 49d084721b6a8f187702f51342e36c9570648f3b Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 3 Oct 2023 09:17:32 +0200 Subject: [PATCH 2/2] FIX regression on rounding stocks fields on product list --- 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 e477d1a698c..20b812902d0 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1703,7 +1703,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)).' '; } - print price(price2num($product_static->stock_reel, 'MS')); + print price(price2num($product_static->stock_reel, 'MS'), 0, $langs, 1, 0); } print ''; if (!$i) { @@ -1717,7 +1717,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)).' '; } - print price(price2num($product_static->stock_theorique, 'MS')); + print price(price2num($product_static->stock_theorique, 'MS'), 0, $langs, 1, 0); } print ''; if (!$i) {