• Resolved zauroman

    (@zauroman)


    Woocommerce tax system is not working correctly. You just add a percentage to the number, and you need to create an inverse percentage to the number. When the amount is credited to the account, we pay 6% tax. Example:
    100+6%=106
    106-6%=99,64 !!!! It should be 100!

    The right formula:

    100%-6%=94%

    100/94=1,0638

    Then 6%= 6*1.0638=6.3828

    100+6,3828=106,3828

    THE RESULT: 106.3828-6%=99.99 true!

    How to fix it?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hello,

    I understand your point. You can find the formulas on the following links.

    For tax inclusive calculation, you can find the formula here

    tax_amount = price - ( price / ( ( tax_rate_% / 100 ) + 1 ) )

    For tax exclusive, it is here.

    tax_amount = price * ( tax_rate_% / 100 )

    [Source].

    Let us know if there are any questions.

    Thread Starter zauroman

    (@zauroman)

    I don’t understand the code, tell me how can I solve my problem? Where and what should I specify?

    Hello,

    Sorry for the confusion, it is not a code, they are the formulas used in the background to calculate taxes. In WooCommerce to set up taxes you will need to tell WooCommerce if your prices will be inclusive or exclusive of taxes, you can define your tax rates, and the taxes will apply depending on the customer location.

    Checking your example, the formulas will work like this:

    For tax exclusive, in this case, the tax is calculated and added to the price. The price is 100, and the tax is 6, total 106.

    tax_amount = price * ( tax_rate_% / 100 )
    tax_amount = 100 * ( 6 / 100 )
    tax_amount = 100 * ( 0.06 )
    tax_amount = 6

    For tax inclusive, please note in this case your price is including the tax, the final price is 106 because it is including the tax.

    tax_amount = price - ( price / ( ( tax_rate_% / 100 ) + 1 ) )
    tax_amount = 106 - ( 106 / ( ( 6 / 100 ) + 1 ) )
    tax_amount = 106 - ( 106 / ( ( 0.06 ) + 1 ) )
    tax_amount = 106 - ( 106 / ( 1.06 ) )
    tax_amount = 106 - ( 100 )
    tax_amount = 6
    

    In the example you gave us at the beginning of this thread, be sure to navigate to WooCommerce > settings > tax, and enable prices inclusive of tax.

    To learn more, please check:
    Setting up Taxes in WooCommerce.

    How Taxes Work in WooCommerce.

    Let us know if there are any questions.

    Link to image: https://snipboard.io/5BTtdw.jpg

    Thread Starter zauroman

    (@zauroman)

    I’m telling you the exact opposite. I have already done a 6% tax for a long time. But he just adds 6% to the price and that’s it. I need the inverse percentage, according to the formula I wrote to you in the first letter. You’re sending me something I’ve already done a long time ago

    Hello,

    I need the inverse percentage

    I understand that you would like to get the inverse percentage, can you please provide us with more information about what is the goal? Can you please elaborate? So that we can point you in the right direction. Thanks.

    Thread Starter zauroman

    (@zauroman)

    The tax service takes 6% of the turnover amount from me. That is, from 100 rubles – 6% = 94 rubles I will have left. I need to specify the tax so that I receive 100 rubles already minus 6% tax. That is, after adding 6%, the amount should be 106.3828

    Hi there @zauroman ??

    The tax service takes 6% of the turnover amount from me. That is, from 100 rubles – 6% = 94 rubles I will have left. I need to specify the tax so that I receive 100 rubles already minus 6% tax. That is, after adding 6%, the amount should be 106.3828

    Thanks for reaching out, let’s figure out why things are not lining up!
    I might be wrong but, from what I gather, something is off with how taxes are already setup at the store; or switching the Prices entered with tax might be in order.

    Could you please share a screenshot of how the tax settings are currently set up? Here is an example from a test installation of mine (screenshot directly linked here).

    Kindly note that, for changing product prices en masse, it is possible to export them, edit their prices in the resulting .CSV file with a program like Google Spreadsheets, and re-import them to the store. The options to export/import are available up-top, in the Products screen (as showcased here).

    I trust that points you in the right direction, but if you have more questions, let us know. We’re happy to help.

    Thread Starter zauroman

    (@zauroman)

    https://snipboard.io/xK3s0y.jpg

    I have everything installed correctly. You can’t understand what I’m talking about apparently ??

    Woocommerce tax system is not working correctly. You just add a percentage to the number, and you need to create an inverse percentage to the number. When the amount is credited to the account, we pay 6% tax. Example:
    100+6%=106
    106-6%=99,64 !!!! It should be 100!
    
    The right formula:
    
    100%-6%=94%
    
    100/94=1,0638
    
    Then 6%= 6*1.0638=6.3828
    
    100+6,3828=106,3828
    
    THE RESULT: 106.3828-6%=99.99 true!
    
    How to fix it?
    Thread Starter zauroman

    (@zauroman)

    Let’s try another way. These are the settings I have now set. https://snipboard.io/3AJ8Rk.jpg
    https://snipboard.io/xyD3Or.jpg
    You have a tax of 81.11 rubles
    But 1433-6%=85.98 rubles

    Why do you get 81.11 rubles?

    Thread Starter zauroman

    (@zauroman)

    In general, I solved everything with this function

    add_filter( 'woocommerce_price_inc_tax_amount', 'wp_kama_woocommerce_price_inc_tax_amount_filter', 10, 4 );
    
    function wp_kama_woocommerce_price_inc_tax_amount_filter( $net_price, $key, $rates, $price ){
        return $price * ($rates['rate']/100);
    }
    • This reply was modified 2 years, 3 months ago by zauroman.

    Hi there,

    In general, I solved everything with this function

    I see. A calculation inclusive tax.

    Thank you so much for adding your input! Some of our customers might indeed find this guide helpful!

    We appreciate you being an active part of the community ??

    Sorry for the late reply, we had a problem in our internal system recently.

    I’m going ahead with marking this thread as solved now. Feel free to open a new one, should anything else arises.

    Have a wonderful day!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Wrong tax’ is closed to new replies.