New: Update only the multiprices that have been changed

When a multiprice was changed all level prices were updated at once and history of prices is getting very large.
This commit is contained in:
JC Prieto 2018-11-22 12:38:10 +01:00 committed by GitHub
parent 784c13d9d0
commit 54418c168b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -351,7 +351,10 @@ if (empty($reshook))
break;
}
$res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']);
if($object->multiprices[$key]!=$newprice || $object->multiprices_min[$key]!=$newprice_min || $object->multiprices_base_type[$key]!=$val['price_base_type'])
$res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']);
else $res=0;
if ($res < 0) {
$error ++;