- Posts: 209
- Thank you received: 18
Price calc with tax
When I add the price with tax and then click into the price box it correctly calculates the pre-tax price. eg: $365.00 price with tax calculates the price before tax as $331.818181818.
As soon as I hit "Apply" the prices revert to $364.999998 price with tax and $331.818181818 price before tax.
This is my currency setting:
Is there some new setting I need to change somewhere in v2 to keep the price with tax at 2 decimals?
Tkx in advance.
Please Log in or Create an account to join the conversation.
The price with tax is re-calculated on apply based on the price without tax. That's why the price with tax change.
Just change the price without tax value to obtain the price of $365.0.. and all the prices displayed will be well rounded.
Please Log in or Create an account to join the conversation.
In a store using Hikashop version 1.5.8, all I need to do is enter $365.00 into the post tax price and it calculates the pre tax price without changing the post tax price at all.
This is from a store using 1.5.8:
Okay - but means that now knowing the pre-tax price to it's full decimal value is key to getting the right prices shown. A few Excel worksheets no doubt... But if there is a workaround to what appears to be a rounding problem it would be appreciated.
Thanks.
Please Log in or Create an account to join the conversation.
in v2.0 this line
$price->unit_price->price_value_with_tax=($price->price_value_with_tax);
in v1.5.8 there is this line..
$price->unit_price->price_value_with_tax=round($price->price_value_with_tax,$rounding);
And other lines in v2 that don't appear to explicit the rounding.
So, is there some setting in v2 where you can tell the system to round?
Telling my admins they have to calculate and enter pre-tax prices to 9 decimals is going to be very painful.
Please Log in or Create an account to join the conversation.
We removed the rounding on prices in HikaShop because it was generated a lot of problem for right price processing.
After that, in the front-end, rounded prices are displayed. But, in the database, right (and precise) prices are stored because otherwise it generates price errors.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Any chance of a better solution in future versions?
Please Log in or Create an account to join the conversation.
We will see if we change that in the future. Actually I suggest you to enter the price with tax like "365.0000022" for the wanted taxed price "365"
Please Log in or Create an account to join the conversation.
- Posts: 127
- Thank you received: 12
I actually changed how HS dealt with the calc myself to get around the issues on 1.5.7.
So my question, just upgrading to v2 won't change the DB values to be held to more decimal places I assume. The change only takes place on a price edit.
Is that correct?
Tony
Please Log in or Create an account to join the conversation.
The product database entries are not modified during the HikaShop update.
Your product prices won't be affected.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
For example, an item selling at $145 (including 10% tax):
Before save:
Enter pre-tax: $131.81818181818 to calculate $145 with-tax (yes! 11 decimals required!!)
After save:
Pre-tax = $131.81818 and with-tax $144.999998
In fact, where Jerone says that the prices are stored precisely in the database, this is not the case as my pre-tax price is only being stored to 5 decimals. In effect - BOTH prices seem to be now incorrect.
I know it seems moot, but I would have thought that a correct price in an online store front and back end would be fundamental.
Can we get back the original rounding fix? Or is there someplace where I can still download v1.59 or v1.6.
Please Log in or Create an account to join the conversation.
This is not a limitation of HikaShop but it is your database.
If you want more precision in HikaShop, you have to modify your table #__hikashop_price and change the type of the column "price_value".
Your actual type should be "decimal(16,5)" and you want "decimal(16,11)" (or "decimal(24,11)" if you want more accuracy for big numbers).
We would not found more precision with HikaShop 1.5.9 or HikaShop 1.6.0
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I don't understand your question.
HikaShop use decimal(16,5) for his prices and because you need more accurate, you should change it.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.