Jump to content

Rounding Problem


Daffuzz

Recommended Posts

10 hours ago, Curious said:

Just take more decimals in your price excl tax.

For example 10 euro incl. 21% tax, take 8,264462 excl. tax

This don't solve the problem prestashop after than round it up or down and than prices are not correct

Link to comment
Share on other sites

  • 2 months later...
On 1/15/2018 at 10:56 AM, Daffuzz said:

Maybe this fix has a solution of this problem?

#8468: Fix wrong typehinting on attribute prices?

Solution not  fixed yet, maybe presta has fixed with 1.7.4.0 update, searching for solution in google, I see it's always been huge problem.

Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

Just had to walk through the entire fricking application in my spare time to find this problem.....

Change the file "classes/Tools.php" and find the "public static function ps_round($value, $precision = 0, $round_mode = null)"

Add the following line:

if($precision == 0){ $precision = 2; } //Or any other number you want

Somehow the precision was always empty this fixed it for me.

Hope this helps atleast someone

Edited by JKoele (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Hope some one can help me out.

Used this fix, and it did something, but not exact.

When i use 4.94, incl. 21% tax, price round up to 4.95 - thats good.
If i use 4.95, incl 21% tax, price rounds up to 4.96 - not good.

Strange thing, when i use a combinations which add 10 incl, tax on price 4.95, price does displayes corrects at 14.95.

What am i doing wrong?

Using PS 1.7.5, price rounding in shop parameters is set at round up to closest value, using 2 decimals and rounding on each rule.

If i use round up when halfway there, price 4.94 becomes 4.95 - thats good.
But - the price + combination that became 14.95 (good ) now suddenly becomes 14.94 (wrong).

So, i problem solved triggers another XD

 

On 4/18/2020 at 5:39 PM, JKoele said:

Just had to walk through the entire fricking application in my spare time to find this problem.....

Change the file "classes/Tools.php" and find the "public static function ps_round($value, $precision = 0, $round_mode = null)"

Add the following line:

if($precision == 0){ $precision = 2; } //Or any other number you want

Somehow the precision was always empty this fixed it for me.

Hope this helps atleast someone

 

Edited by m.rtr (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Having same issue. Mostly happens in big orders, with many products in cart. It seems, Prestashop calculates taxes in each product line, but not in the totals. Tried to solve the problem many ways but always with a little difference of cents in taxes and invoices.

What we did is to configure rounding configurations like this:

Round mode: Round up away from zero...recommended
Round type: Round on total.

Anyways, this does not solve completely the error, as we have some orders with 1 to 5 cents differences, between total taxes and taxes on left side of the invoice, see attached.

This is an intolerable mistake from an ecommerce service.

Using Prestashop 1.7.7.5.

rounding-prestashop-17.jpg

invoice.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...