From e4078477c6c05d51caabeacfd8b5004bed0dffcb Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 20 Jan 2025 17:32:08 +0100 Subject: [PATCH] fix: allow list mass action update price when price mode is multiprice price --- htdocs/core/actions_massactions.inc.php | 3 +-- htdocs/core/tpl/massactions_pre.tpl.php | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 3f06f4f3e8c..e84c02a8c93 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1291,8 +1291,7 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa $newprice = $object->multiprices[$level] * (100 + $pricepercentage) / 100; $minprice = $object->multiprices_min[$level]; } - $ret = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, $level, $object->tva_npr, 0, 0, array(), $object->default_vat_code); - + $res = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, $level, $object->tva_npr, 0, 0, array(), $object->default_vat_code); if ($res > 0) { $nbok++; } else { diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 3c321f10123..bdbcee257f5 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -112,7 +112,12 @@ if ($massaction == 'preupdateprice') { 'value' => $valuefield ); - print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $langs->trans("ConfirmUpdatePriceQuestion", count($toselect)), "updateprice", $formquestion, 1, 0, 200, 500, 1); + $descConfirmPreUpdatePrice=$langs->trans("ConfirmUpdatePriceQuestion", count($toselect)); + if (getDolGlobalString('PRODUIT_MULTIPRICES')) { + $descConfirmPreUpdatePrice=$langs->trans("ConfirmUpdatePriceQuestion", count($toselect)*getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT') .' ('.$langs->transnoentities('PricingRule').', '.$langs->transnoentities('MultiPricesNumPrices').')'); + } + + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $descConfirmPreUpdatePrice, "updateprice", $formquestion, 1, 0, 200, 500, 1); } if ($massaction == 'presetsupervisor') {