Problem with Woocommerce rounding
-
Hi,
I have a problem for which I can not find a solution.
The net prices in Backend are calculated incorrectly.
I’ve already tried all the solutions I’ve found on the internet, even setting the decimal places to 4.
do you have a solution? I’ve linked an screenshot above.
The page I need help with: [log in to see the link]
-
That doesn’t appear to be the default WC display in the backend.
That looks like a Cart display on the front end.
no its in the Backend in Order Details
Confirmed.
73.33 but should be 73.37Maybe that’s why we have a lot of problems with the woocommerce reports…
I believe this is an issue with rounding up or down.
Mike explains it better here. See if you can adjust, play around with the numbers and get it to work for you.
@serafinnyc Rounding is applied on each products, not on the subtotal ?
Because, 73.33337 (the real value) should be rounded to 73.34 or 73.33, not 73.37 as WC actually does.Also, the only workaround I see looking at Mike’s post, is to use tax exclusive prices on products. As I’m using tax-inclusive prices actually.
Everybody is going to have a varying degree of difference. Taxes on Product, Taxes on Shipping on Products and then Tax which God only knows.
Then there are some themes I’ve seen in their functions doing calculations that conflict with it as well.
It’s crazy.
Then, the formula needs to be fixed in Woocommerce core.
Tax and amounts should be 100.0000000% exact in reports. Our accountant is saying “fix that mess” and he’s right.If you manually calculate amounts and taxes, opening each orders one by one on a month, then you go to reports, there is differences. It should not, it’s driving us and the accountant crazy.
I’ll try to change the price of all products to Tax-exclusive. Hoping it will be applied to older orders and not only the new ones.
LOL accountants, what do they know? Ours takes all year just to do our taxes. Ugh.
I agree, it can be a pain. I personally haven’t run into the problem though. I know it drives Mike to drink. Again, it comes down to so many factors.
@lump3000 & @pumpk1in can you please add more info on:
– what is the product price you’ve entered,
– is it tax inclusive/exclusive,
– what is the tax rate that should be applied,
– what is the total tax amount that was calculated in Woo vs the total tax amount that you were expecting?Even though there’s no tax rounding method that would give 100% accurate results for all possible tax rates and product prices, we can at least verify these calculations against a spreadsheet and a clean WooCommerce installation.
BTW if you’d like to try rounding taxes on subtotal level rather than for each product separately, there’s an option for this under WooCommerce > Settings > Tax:
Screenshot: https://cld.wthms.co/zNua2c
Cheers!
Hi @madeincosmos !
Thanks for help.
I did some tests while waiting, and I found something.Settings on my live website :
Product prices : Tax INCLUDED
Tax rate : 20%
Product price : 8.00 (so, tax included)Settings on DEV website :
Product prices : Tax EXCLUDED
Tax rate : 20%
Product price : 6.67 (so, tax excluded)Now, I created one new order on the two websites, with 11 of the same product :
On live, in the backoffice :
Cost : 6.67
Qty : 11
Total : 73.33 (false.)
VAT : 14.67On dev, in the backoffice :
Cost : 6.67
Qty : 11
Total : 73.37 (correct !)
VAT : 14.67SO, it seems that the VAT is correctly calculated when tax is included and also when tax is exluded (14.67 is correct), BUT, the Total seems to have a problem when product prices are tax included.
As 6.67*11=73.37 I don’t understand why on the first case it shows 73.33
Thanks ??
Ps : I already tried your setting, for the rounding, no changes.
Ps2 : Also, I don’t know if that problem is the source of my reports problems.@pumpk1in thanks the extra details. I see what you mean now. It looks that you’d like the tax to be rounded at a single item, and then multiply the already rounded amount by the number of products purchased.
What WooCommerce does instead is calculating tax for the invoice line as a whole. This means we take the price of all 11 products, calculate 20% tax based on that, and then round it to the nearest cent.
Here is a detailed breakdown of where the difference comes from:
Screenshot: https://cld.wthms.co/2o3qrD
You might want to double check this with your accountant, but all tax guides I’ve found recommend rounding taxes per invoice line rather than single items, as the tax rate wouldn’t match otherwise. For example.
73.37 * 20% = 14.67, not 14.63
And then if we tried to add them:
73.37 + 14.67 = 88.04, so the total amount doesn’t match either.
Hi @madeincosmos !
Thanks for this detailed answer ??
The problem of my accountant is not really that. (But I totally understand your explanation)Each month, we send them :
- The values that we found in Woocommerce reports (VAT, shipping VAT, shipping value, total tax included, total tax excluded, etc…)
- All the orders Invoices in PDF format, exported from the back office
They take all the invoices and then do their calculations (basically, a big addition). And they compare to the Woocommerce reports values we reported before. They never match.
For example, they can found, additioning all the invoices, a Total VAT included of 20524,39 while in the report we have 20539,39
And a TVA total of 3361,56 while in the report we have 3406,84With numbers that big each month, and so much difference, we just can’t trust the WC reports.
That’s the problem and why I started to search a solution here ??
Thanks.
@pumpk1in this sounds like an entirely different problem than the one you first mentioned. Reports in WooCommerce is basically one giant sum across all orders within given timeframe, so the first thing that comes to my mind if the numbers don’t match is that perhaps there’s a few hours difference between the site timezone and the actual timezone you live in. You can check this under Settings > General in WP Admin. If the timezones don’t align and there are any orders placed during the first/last few hours of the month, this might skew the reports one way or another.
If that’s not the case, we’ll need a reproduction scenario of how the reports go wrong, ideally on a site with no other plugins than WooCommerce. It can be a daily/weekly report if possible, it should be easier to add everything up this way. If you can place one or a few test orders there, and the order/tax totals won’t match the order/tax totals in the reports, this will be a great starting point to start looking for a solution. We’ve had one person contacting us recently about WooCommerce reports, but they didn’t include any details in their request:
https://github.com/woocommerce/woocommerce/issues/23193
Without a reproduction scenario that we can follow on another site, it’s impossible to tell what exactly could have gone wrong–could be a tax rounding problem, interaction with the theme or another plugin, or even human error. If you can send us some screenshots of such minimal incorrect report and orders included in that report, this is something we can look into further.
@madeincosmos thanks again !
Instead of screenshots, I could create a replica of the live website and give you full access on it ? So you can see by yourself the numbers and do some checks faster if you need and compare with our accountant numbers.
Is that an option ?
Thanks
- This reply was modified 5 years, 6 months ago by Olivier.
@madeincosmos Just in case you forgot to reply… ??
Thanks ! ??
- The topic ‘Problem with Woocommerce rounding’ is closed to new replies.