DrByte:
The patch provided doesn't take into account the very unusual action of changing the entire store from tax-added to tax-included. That requires manual editing of each price to remove the tax component, because it still adds the tax at checkout (just displays it differently).
Was not really my idea, the tax authorities were pushing me to show the tax value on the invoice :(
Anyway turned out OK.
I ran Change tax category "UPDATE products SET products_tax_class_id=1;"
The few products in a different tax class I changed manually to tax_class_id=2
Then I ran "UPDATE products SET products_price = products_price /(1 plus tax rate) WHERE products_tax_class_id=1;"
Did the same for tax_class_id=2
Then I ran Fix tax in attribute prices; "UPDATE products_attributes SET options_values_price = options_values_price/(1 plus tax rate) WHERE options_values_price <> '0';"
Then I ran Fix tax in specials prices; "UPDATE specials SET specials_new_products_price = specials_new_products_price/(1 plus tax rate) WHERE specials_new_products_price <> '0';"
The few attributes and specials for tax rate 2 I changed manually, I could also have tried multiple WHERE statements.