VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: sandomatyas on January 29, 2020, 17:26:06 PM

Title: Double rounding for shipping fee?
Post by: sandomatyas on January 29, 2020, 17:26:06 PM
There is a shop with 27% VAT and zero decimals for the currency. The shop owner wants to set a shipping fee with this tax. The gross amount should be 990. I set the fee to 990/1.27=779.527559 but I got 991 as gross price. I tried to change the net amount but I was not able to get 990 only 989 or 991
So I checked the vmPSPlugin.setCartPrices method and found this:
$cart_prices[$this->_psType . 'Value'] = $calculator->roundInternal ($this->getCosts ($cart, $method, $cart_prices), 'salesPrice');
It rounds 779.527559 to 780
And after taxrules were applied roundInternal is triggered again

So if I'm right you need the first roundInternal only if there are no taxrules to apply
Title: Re: Double rounding for shipping fee?
Post by: jjk on January 29, 2020, 20:26:24 PM
In VM Configuration 'Pricing' tab, check "Round only display". Should work in this case.