News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

All prices are rounded BEFORE calculation is executed

Started by pooyan, January 20, 2012, 23:43:56 PM

Previous topic - Next topic

pooyan

Hi all,

I have a problem with a calculation rule for adding the tax to a net price.
Because all price values are rounded BEFORE the calculation is processed, I get rounding errors.

An example:
I want to have a gross price of 8.80€ (should be the salesPrice).
The net price is: 7.39496, and I have a calculation rule (type Tax) with a value of 19 (+%).

The problem:
In calculation.php (function getProductPrices(...)) all prices are rounded to 2 decimal places. Also the incoming price of the calculation!
So the following is done in method interpreteMathOp(...): (7.39 * 19 / 100) + 7.39 = 8.79€ -> not the expected result!

What is my mistake? Seems to be incorrect!?

Thank to all in advance




loobi

I have a similar problem, it is rounding my prices up. My selling price (gross price) is £6.99, and VAT tax is +20%, calculated net price is £5.8250. The calculated 20% VAT is then £1.17 ( actual is £1.165 which it rounds up to £1.17), when added to the net price it shows selling price as £7.00.  I have tried setting decimal points to 3 in 'edit store', it still calculates the VAT at £1.170 not £1.165.

I am using Joomla 1.5.15 and Virtuemart 1.1.4.

loobi

To clarify my above post, the shopping cart shows selling price as £6.99. When they confirm order the next screen is the paypal confirmation screen which shows price as £7.00. When the customer receives the confirmation purchase order it shows selling price as £7.00.

Milbo

hmmmm
maybe the new version dont have that problem, because we changed the db format to decimal which is exacter than float.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jenkinhill

Quote from: loobi on January 26, 2012, 16:59:40 PM
I am using Joomla 1.5.15 and Virtuemart 1.1.4.

Really??? This is the VirtueMart 2 forum section......
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum