From 368f5e57a97c7ad9686453217e957ab564bd009c Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 2 Oct 2022 20:03:42 +0200 Subject: [PATCH 1/7] 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/7] 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) { From 06bbb9517b25c2a5d9651e1cbef264a7145f4838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Fri, 6 Oct 2023 17:02:26 +0200 Subject: [PATCH 3/7] FIX: Use of line->insert instead of line->create --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index abf44b34cb1..7759c22de4a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9317,7 +9317,7 @@ abstract class CommonObject $line = (object) $line; } - $result = $line->create($user, 1); + $result = $line->insert($user, 1); if ($result < 0) { $this->error = $line->error; $this->db->rollback(); From 7e7603cb003bcdbe4047a251095c494ea49be926 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 8 Oct 2023 19:44:15 +0200 Subject: [PATCH 4/7] FIX use event.key instead event.wich to avoid keyboard difference --- htdocs/product/stock/tpl/stockcorrection.tpl.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 793c0dcd1e4..6462f9b2c02 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -67,16 +67,16 @@ print '