• Resolved kayakondacs

    (@kayakondacs)


    Hey there. I would like to ask you for help.

    Currently my woo is summing up the order, calculating VAT and THEN adding shopping rate (VAT included already).

    I would like to run it diff way: sum up order products (no VAT) > add shipping rate (no VAT) > calculate and add VAT from this final number (products + shipping rate).

    Anybody willing to help me with this one? Thank you a lot!!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    Manipulating the cart calculations is too advanced for this kind of forum. Here are some resources that provide background information: https://github.com/woocommerce/woocommerce/wiki/How-Taxes-Work-in-WooCommerce & https://jeroensormani.com/guide-shipping-taxes-woocommerce/

    Why do you need this? Would the result not be the same.
    Lets say we have:

    Tax Rate 19%
    Product A = cost of 2
    Product B = cost of 3
    Shipping = cost of 4

    If I add the taxes to each product before summing up:
    2*1,19 + 3*1,19 = 5,95

    If I add the product prices first and apply tax afterwards:
    5*1,19 = 5,95

    and then add shipping to either afterwards:
    4*1,19 = 4,76
    5,95 + 4,76 = 10,71

    Or do it like you say, add all up first and then apply tax:
    (2+3+4)*1,19 = 10,71

    No difference, no?

    Kind regards,

    Thread Starter kayakondacs

    (@kayakondacs)

    Hello,

    thank you for your answer. The thing is, it depends on the price =(
    FOR EXAMPLE:

    TAX RATE: 20%
    Product A: cost 2,26€ (no TAX) – ordered 3 pieces
    Product B: cost 5,94€ (no TAX) – ordered 1 piece
    Product C: cost 3,65€ (no TAX) – ordered 1 piece
    Shipping: cost 2,42€ (no VAT)

    This is how it should be according to our tax laws:
    2,26*3 + 5,94*1 + 3,65*1 + 2,42 = 18,79€ no VAT >>> 18,79*1,2 = 22,55€ (total VAT incl)

    But at the moment it works like this:
    2,26*3 + 5,94*1 + 3,65*1 = 16,37€ (no VAT) >>> 16,37*1,2 = 19,64€ (VAT incl)
    19,64 + 2,90 (shipping VAT incl) = 22,54€ (total VAT incl)

    I know it is just 1 cent, but it keeps messing with my accounting pretty ugly =((

    Thank you a lot for your help!

    • This reply was modified 6 years, 7 months ago by kayakondacs.
    Plugin Support con

    (@conschneider)

    Engineer

    Ah rounding. ??
    I am no tax super hero when it comes to it is PHP functions, but I know the limits of PHP when it comes to exact calculations.

    While you can pursue to try and change the order of calculations, I would advise to live with the rounding error and factor it into your calculations. The trade off for correcting this is not worth your time and it will be tedious to keep track.

    I think it is better to live with the rounding imperfection than trying to get this correct 100%.

    Thread Starter kayakondacs

    (@kayakondacs)

    =))) ooookay thank you for the advice. I would gladly take it, but my accountant is kinda strict on this one and does not accept these differences. At the moment it is enough for me to know of it is possible to change this within the functions or impossible at all…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shipping VAT calculating’ is closed to new replies.