This is not exactly a bug, but not exactly a feature request -- it's an interoperability issue. But if you think it's inappropriate to post here, please close and I'll move it to one of the ubercart forums.
I'm porting uc_coupon to D7 and would like to carry over longwave's solution to the problem of discounts applied to products that are taxed at different rates. That solution was only ever implemented in the uc_vat module, which has not yet been ported, but it should be made available in uc_taxes itself. The attached patch (to the latest DEV) accomplishes this.
(Note: this also requires a small change to the logic of the tax_adjustment callback, which should now return the taxable value of the line item, not the actual tax amount).
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1155656-uc_taxes-line-item-adjustment.patch | 692 bytes | longwave |
| uc_taxes-line-item-adjustment.patch | 2.23 KB | wodenx |
Comments
Comment #1
wodenx commentedComment #2
wodenx commentedThe current D7 version of uc_coupon will work with uc_taxes as it stands - I make the required adjustment in a hook_uc_line_item_alter() implementation - but I still think longwave's original solution is probably better - at least it provides a mechanism for other line items to modify the tax calculation as well.
Comment #3
longwaveDo we need the checkbox setting in D7? Would you ever want to turn it off? Looks like we could just use the tax_adjustment callback where it exists, and the plain amount otherwise.
Comment #4
wodenx commentedYou're probably right - I was just trying to reproduce as exactly as possible the mechanism you'd created for uc_vat. :)
If you do commit something like this, especially if it can't be turned off, please post exactly how it works bc I'll have to modify uc_coupon accordingly.
Comment #5
longwaveAttached patch is a simpler version of the original, removing the setting and always calling the tax_adjustment callback if it is defined.
Comment #6
wodenx commentedI'd like to give this a bump, as I've just realized that coupon discounts for tax-inclusive products or mixed tax-rate orders are currently broken for Paypal WPS. The workaround I implemented (altering tax line items) doesn't fix WPS orders, which calculate the tax separately from the line item. This patch is based on longwave's solution from uc_vat in D6, is simple, and seems to work well. Any chance of its being committed soon?
Comment #7
longwaveCommitted. The tax_adjustment callback should really be documented, but I guess as uc_coupon is the only user then it will have to serve as a reference point for now.