• Resolved evmapa

    (@evmapa)


    Hi! I’m in serious need of help, please, because woocommerce does not add correctly and this is causing me trouble with my taxes.

    In this example, I have a subtotal of 35.09 incl. 10% tax. I have a voucher of -5.28 including 10% tax, I have shipping of 4.95 including 10% tax. This should add up to 34.76 but woocommerce claims it’s 34.75 and that’s what the customer paid. The strange thing is, the taxes are calculated correctly at 3.16, but since the total is different, the taxes are actually wrong. Can anyone tell me what’s going wrong here? Thank you!

    • This topic was modified 6 years, 10 months ago by evmapa.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    You’re running into the joys of tax rounding. ??

    You will need to change around your setting for ’rounding”, which you can find under WooCommerce > Settings > Taxes.

    If you enable Rounding tax at subtotal level, instead of per line, the rounding is done at the Subtotal level. Check your tax jurisdiction to know if this is done.

    Thread Starter evmapa

    (@evmapa)

    Hi! Thanks for your reply! I have it set to round at the subtotal level. But in this case there shouldn’t be any rounding at all so where is the error coming from?

    Some quick backstory of a related error if you care to read about it, since it leads up to why this can’t (or shouldn’t) be a rounding error.

    —–
    Due to the way we have to submit our taxes I have to do some calculations with the unrounded tax numbers split up by tax class, which I export from the database. They aren’t completely unrounded of course, but the six decimal places are precice enough for my purposes. Or should be!

    Only, the numbers are incorrect! For example, I had a total of €8.55 including €4,90 shipping taxed at 10%. That should have given a tax of 0.777273 but the exported tax was 0.781818. Completely wrong.
    ———-

    I never could figure out where those numbers were coming from, so in desperation I changed ALL our prices so that the tax would never have more than two decimal places (with the exception of shipping and vouchers, which have three decimal places when calculated with 20% tax, since there is no total that works equally well for 10% and 20%)

    If you take a look at the numbers in my first post, they are all strangely precice (5.28, 4.95, 35.09). That’s by design, all in order to only get a maximum of two decimal places of calculated tax.

    5.28 includes a 10% tax of 0.48
    35.09 includes a 10% tax of 3.19
    4.95 includes a 10% tax of 0.45

    And yet, in this order, when I apply the voucher of 5.28 it steals a cent from the total and everything is out of whack again. There should be zero rounding going on, so why is it doing this?

    I’m seriously running out of ideas here ??

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    I have it set to round at the subtotal level. But in this case there shouldn’t be any rounding at all so where is the error coming from?

    WooCommerce usually uses 4 decimal places for taxes, which means that when prices are shown at checkout, those 4 decimal places are rounded to 2 places. Here’s a good example:
    https://github.com/woocommerce/woocommerce/issues/14458

    However, you’re far past that. ??

    What method are you using to export the tax numbers from the database?

    Also, can you please share a screenshot of a full order with me, where the rounding is off? An order with just 1-2 products would be far easier, as I’ll work through the math from this side as well.

    Thanks!

    dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hi @evmapa

    Did you find a solution to your query?

    After your initial reply we haven’t heard back from you in a week, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    If you have a solution, you can still add this as a comment on this thread.

    Thanks,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Woocommerce doesn’t add prices correctly and I need help!’ is closed to new replies.