fix: allow list mass action update price when price mode is multiprice price

This commit is contained in:
Florian HENRY 2025-01-20 17:32:08 +01:00
parent 02dea8d103
commit e4078477c6
2 changed files with 7 additions and 3 deletions

View file

@ -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 {

View file

@ -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') {