Jump to content

problem with incorrect VAT calculation


Recommended Posts

hi,

 

i'm working on some export functions to get my order info into my accounting software

 

it would be nice if i can get the total price of the order excluding VAT

on my shop, all prices are shown including 21% VAT

 

in the 'ps_orders' table, there is a column 'total_products' which should give me the total amount of products (so without transport) excluding tax.

'total_products_wt' gives me correct numbers including tax (what customer payed)

 

but i get very strange numbers in this column

ie:

total_products_wt: 414.00 (correct price including 21%)

total_products: 342.20 (should be 414/1.21=342.15)

or:

 

total_products_wt: 100 (correct =price including 21%)

total_products: 83 (should be 100/1.21=82.64)

 

the difference is to much to be just a rounding problem, right?

 

i do not use any discount prices or attribute prices (only color that has no effect on price)

 

if i check classes/Order.php, i can not see a problem (but maybe i'm looking in the wrong place)

 

i searched the whole forum, but did not find anyone else with this problem (maybe nobody has looked into the database?)

can someone check this, and does anyone have a solution?

 

thank you!

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...

@tuk66

 

I know you can say, take a new latest version, but some of us can not change easy.

i have a lot of personal changes to my version.

my version is : 1.3.1.1

so maybe somebody knows where to solve the problem in what class so we can keep using this quit personal version.

 

thx

Link to comment
Share on other sites

here the complete explantion, hope anybody can help me to solve.

in the back office I see on the order product line this :

3.83 * 15 = 57.45

 

errortax.JPG

 

in the detail order box = 

products = 57.5

shipment = 4.99

total = 62.49 -> this is what customers pay

 

but to be correct the customer must pay : 62.44

since 15*3.83=57.45 and not 57.5

 

so anybody who can tip me where in what file I can change some code so the value that goes into ps_order that this is correct.

then all the rest will be good on invoice, on backoffice and the payment amount also.

I now changed my prices in the database to max 2 decimals, so product price like 3.185620 becomes just 3.19, when testing I see the total of the product line in the blockcart is now correct, only the total amount is now still wrong, so we are getting somewhere, but I do not find what to change in blockcart code so the total is now just calculated correct.

 

 

 

thx

Edited by deech123 (see edit history)
Link to comment
Share on other sites

You would change the order item amounts (price without tax, tax, total). I suggest not to do it. It is better not to touch that. It is not only one function to fix. The method of calculation is total mess in PrestaShop. I know what I am saying. It have taken tens hours to me.

 

I do change amounts on the invoice instead of the order. This way the total amount is the same and other amounts are recalculated.

Link to comment
Share on other sites

×
×
  • Create New...