VAT price recalculation on product kits is not correct
| Project: | Ubercart 2 VAT support |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Hi,
is it possible to use the correct VAT-calculation on an existing productentry? I have +400 products in my shop with prices VAT incl. and would like to use this module for correct VAT calculation. Right now the VAT will be added on my prices regardless if they contain VAT or no.
There is only the setting for future entries containing VAT but i found nothing for using my actual VAT inlc. prices.
Is it necessary to change manually all productentries, or is there a setting i haven´t found right now? I maybe there is a way to make a bulk edit of my existing prices, similar to if i use the autocalculation of the price when inputting prices containing VAT.
Thanks in advance for every idea.
Yours
ingolf

#1
Subscribing, same issue here.
Have to open and Save every Product to have VAT included in existing Products...
#2
Hi,
haven't found a setting for that, but it is fairly easy to change all the products through UPDATE right in the database, as you can do all the maths you need right in the MySQL Query. Like this:
UPDATE products SET pricewithoutvat = pricewithoutvat*1.16;
Have a look at the MySQL docs for more info - and remember to backup your database before you try anything like that.
#3
You can work around this with the "Keep VAT inclusive prices the same after a rate change" option available in recent development releases.
Please make a backup of your database before trying these steps in case anything goes wrong!
1. Go to /admin/store/settings/taxes/vat and disable "Keep VAT inclusive prices the same after a rate change".
2. Edit your tax rule and set the rate to 0%.
3. Go back to /admin/store/settings/taxes/vat and enable "Keep VAT inclusive prices the same after a rate change".
4. Edit your tax rule again and set the rate to the correct percentage.
This should recalculate all prices in your store so they will stay the same to end users, but the ex-VAT prices will be correctly recalculated against the current rate. This will only work if all your prices already include VAT, if you have added new products that are ex-VAT then you will have to work around this yourself.
#4
Nice workaround longwave. I have 3000+ lines (and haven't finished populating yet!), so I have someone else to blame if it screws up, rather than a screwup with my own direct manipulation of the database ;-)
Thanks (especially to the developer)
Jon
#5
Using Longwave's workaround works great for all EXCEPT Product Kits. It's increasing the price on these, and not by the new VAT rate, so I think there must be some core logic which is not dealing with the discounted amount (ie it may be discounting the final price by only the VAT exclusive value of the discount amount entered)
eg Product kit consisting: Item 1 £88 inc vat + item 2 £34 inc vat, discount £34 on item 2 (ie it's free) == Changing VAT from 0 to 15% as per longwave above. Now getting the kit price as £98.81 inc vat.
Any ideas or thoughts welcome.
EDIT: UC 2.0 (not rc)
Update: I re-entered the values for the items in one of the product kits detailed above, and got a total price less than the selling price. (Still don't know why I still have the original higher price as shown above. It appears that now (when the prices for components have been re-entered) the discounted amount in the product kit is taken by the module as excluding VAT, whereas it includes VAT.
#6
Product kits need special support as they make internal calculations for the discounts, and I am not entirely sure VAT is handled correctly here. This is further complicated by the fact you can have different VAT rates applied to different products in a kit, and I am not sure how to calculate the discounted VAT in this case!
Further testing and development is needed to make this work fully, any suggestions, patches or offers of sponsorship to help fix this are more than welcome!