From 73dfa7d44a115b153b4b421e23ba6ae5da2c769d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Dec 2020 14:37:02 +0100 Subject: [PATCH] Try a better fix for #15770 --- htdocs/product/price.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 12029ea7cdc..dd56aa42318 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1457,11 +1457,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul // Il doit au moins y avoir la ligne de prix initial. // On l'ajoute donc pour remettre a niveau (pb vieilles versions) - //$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min); + // We emulate the change of the price from interface with the same value than the one into table llx_product if (!empty($conf->global->PRODUIT_MULTIPRICES)) { - $object->updatePrice($object->multiprices[1], $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), $object->multiprices_min[1], 1); + $object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1); } else { - $object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min); + $object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min)); } $result = $db->query($sql);