Active
Project:
Ubercart 2 VAT support
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Dec 2009 at 15:22 UTC
Updated:
11 May 2013 at 11:31 UTC
If a product with VAT is removed from the system after an order with the product has been created, the VAT will not show up when looking at the order. What I have seen is that the order product line is not considered for VAT recalculation and I guess that is because there is no node matching the nid of the order product item.
My view on this is that the VAT of the ordered product and the ordreed product should be stored together for the receipt somehow. My knowledge on the VAT module is not good enough to determine how this could be done, but I hope to be able to investigate this more in the near future.
Comments
Comment #1
longwaveYes, we need the original product node so we know what product class it was and hence which tax rules to apply to recalculate the price. Ubercart should probably just have fixed the altered price into the order here so it doesn't matter if the node is deleted or even if uc_vat is disabled, but we just have to live with that for now. A workaround for now is to unpublish product nodes rather than deleting them, fixing this otherwise is going to require extra data storage to handle this case.
Comment #2
ndmaque commentedi needed a very URGENT fix to this and slapped a quick hack in.
The problem is in the uc_taxes.module uc_taxes_apply_item_tax()
It attempts to load the node, if it fails it treats everything as an admin added 'blank-line' item which is not a taxable type.
We can detect if it is a deleted node because it will have a $item->nid and can do some logic.
In my case we had the csv uploads and did a lookup to get the node->type.
NB: Refresh the order from the admin screen (submit to save) and on re-load the tax comes back.