Updated: Price Rounding process improved in entire QloApps system and Issues in pricing in tables and order edit and reallocation process fixed

This commit is contained in:
Sumit Panwar
2024-09-05 14:49:51 +05:30
parent 47eec5217c
commit d5ed2b1110
24 changed files with 726 additions and 855 deletions

View File

@@ -3800,6 +3800,27 @@ exit;
}
return $base;
}
public static function processPriceRounding($value, $qty = 1, $roundType = null, $roundMode = null)
{
if (!$roundType) {
$roundType = Configuration::get('PS_ROUND_TYPE');
}
switch ($roundType) {
case Order::ROUND_TOTAL:
$value = $value;
break;
case Order::ROUND_LINE:
$value = Tools::ps_round(($value * $qty), _PS_PRICE_COMPUTE_PRECISION_, $roundMode);
break;
case Order::ROUND_ITEM:
default:
$value = Tools::ps_round($value, _PS_PRICE_COMPUTE_PRECISION_, $roundMode) * $qty;
break;
}
return $value;
}
}
/**