Vat Change - Keep End Price The Same

Hi all,
On 1-1-2021 the normal VAT (MwSt) goes back up from 16% to 19% here in Germany, and the low VAT goes back from 5 to 7%.
Therefore I need to change the tax percentages, but I would like to keep the final prices the same for the customer. So a product that costs 20 euro now including 16% VAT, should after 1-1 cost 20 euro incl 20% vat, and for the low vat rates (not many products have this), a product that cost 20 euro incl 5% VAT now, should still cost 20 euro incl 7% VAT after 2020.
When we went from 19% to 16% I did it myself with an export and import raising the prices and then lowering the tax percentage, but I ran into some issues, the most difficult one being the change of the option modifiers. I also had a couple of products that did not import back in correctly.
How would you guys do it? I guess directly in the database would be best / easiest?
Thanks!

What about /admin.php?dispatch=products.global_update

What about /admin.php?dispatch=products.global_update

Won't work, because I can't filter on taxes, and I don't think it changes option modifiers?

Nobody? I don't mind hiring someone who can make a script or so - unfortunately my usual developer has no time until 1-1. So feel free to PM me an offer :)

Odd thing, I have different VAT % depending on the shipping country and the end price for each product remains the same, even for the 0% vat as it is inclusive.

When I read this I got worried and went to change several percentages to try it out but no matter to what percentage I change it to, the price remains the same.

On Administration/shipping & taxes I have the "Price includes tax" checked and that's it.

Odd thing, I have different VAT % depending on the shipping country and the end price for each product remains the same, even for the 0% vat as it is inclusive.

When I read this I got worried and went to change several percentages to try it out but no matter to what percentage I change it to, the price remains the same.

On Administration/shipping & taxes I have the "Price includes tax" checked and that's it.

Yeah that works, but it won't work for my setup. I need prices without VAT in our system since we also sell wholesale with automatic EU VAT nr check, etc...



Yeah that works, but it won't work for my setup. I need prices without VAT in our system since we also sell wholesale with automatic EU VAT nr check, etc...

Hi Flow, I'm kinda confused now as to what you want... I thought you originally stated that your prices include VAT and you want to adjust the prices based on changes in VAT so that the "price including tax" remained the same. But now you state you want prices without VAT?

Trouble with changing price based on VAT is that you'll have to calculate the change in VAT and then reduce the price by that amount. However due to rounding and other math issues, you may not get to the exact same price.... If you want to adjust your prices by some fixed amount (based on delta of VAT change), you could use something like below. But note that it will change all prices for all usergroups. Would require adding constraints to have adjust only selected usergroup_ids.

function my_adjust_prices_by($price_change /* absolute or % e.g 1 or .003% */) {
  $percent_adjust = 0;
  if( strpos($price_change, '%') ) {
    $percent_adjust = floatval($price_change) / 100;
  }
  if( $percent_adjust > 0.00 ) {
    db_query('UPDATE ?:product_prices SET price=`price` - `price` * ?d', $percent_adjust);
    // To include all storefronts uncomment below
    //db_query('UPDATE ?:ult_product_prices SET price=`price` - `price` * ?d', $percent_adjust);
  } elseif ($price_change = floatval($price_change) ) {
    db_query('UPDATE ?:product_prices SET price=`price` - ?d', $price_change);
    // To include all storefronts uncomment below
    //db_query('UPDATE ?:ult_product_prices SET price=`price` - ?d', $price_change);
  }
}
It assume you are adjusting price 'down' and that the amount/percent as the parameter is the amount to adjust the prices. I.e. if VAT changed by 0.03%, that's what you would pass. Note that suggest you backup both the cscart_product_prices and cscart_ult_product_prices tables BEFORE running the above....

UNTESTED

Hi Flow, I'm kinda confused now as to what you want... I thought you originally stated that your prices include VAT and you want to adjust the prices based on changes in VAT so that the "price including tax" remained the same. But now you state you want prices without VAT

Hi Tony,

Thanks a lot for your response. In my admin I have prices without VAT - on the frontend they show including VAT (as obliged in the EU).

6 months ago when we got this temporary change (as covid support the government lowered the VAT), like you said, I adjusted the pricing up by a certain amount, and then changed the VAT. This indeed resulted in some cents being off here and there, but this is not a huge issue - we manually fixed these. I also manually adjusted the discounts for certain user groups.

The problem is mostly the modifiers of the options. We had to do these manually which was a lot of work. Would your script work with these? Maybe you would like to have a look on our dev server and make me a quote for doing this trick this for me?

Thanks!

That function would not handle modifiers. However, it could certainly be modified to so so. That was just an example without much real analysis.

I sent you an email Tony! :)

Just to let everyone know, Tony did a great job writing a script for me so last minute. Thanks again Ez-ms!

You're welcome, glad I could help.