| Project: | Ubercart Discount Coupons |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
I've seen lots of discussion regarding this issue with older versions of the module, but I can't find an obvious solution.
Here's a breakdown of the totals I am getting:
Subtotal:£2.49 [OK]
Free Shipping :£0.00 [OK]
Coupon: DISCOUNT10A:-£0.25 [OK]
Subtotal excluding VAT:£1.91 [OK]
VAT at 17.5%:£0.37 [INCORRECT, should be £0.33]
Total:£2.24 [OK]
All of these are correct except for the tax line which is calculated on the total before the discount has been taken off - hence VAT is overstated.
My tax setup is set to apply taxes to product, shipping and coupon.
We only have one tax rule.
Although the total charged to the customer is correct, we are overstating the Tax on the invoice which is a problem with the tax office!
Any pointers would be appreciated!
Comments
#1
I have also tried the above with the dev version and it still seems to be a problem.
#2
Our issue is
Item 1 - £29
Item 2 - £12
Subtotal - £41
Discount 10% - £-4.10
VAT - £1.38 (should be £1.89)
We have tax setup to apply taxes to product, and coupon. The issue is that item 1 is VAT exempt and item 2 isn't. So the VAT is correctly calculated on item 2 only, but when the VAT it calculated on the discount, it works out a minus vat on the total discount, rather than just the discount for the vat-able products.
#3
Ryan and Tim sorted out a patch for this at DrupalCon Copenhagen. I'll either upload it here or cross post to the Ubercart queue when I have it.
#4
subscribing
#5
subscribing
#6
see http://drupal.org/node/898776
#7
It works fine for me when checking the select box for 'Coupon discount' in 'Taxed line items' in /admin/store/settings/taxes/.
It computes tax on the negative amount of the coupon thus reducing the total tax by the correct value.
#8
@cybis: this is fine if all the items in the cart have the same tax rate, but doesn't work on items with different tax rates.
Tim
#9
Ok, I see. Should have paid more attention to the discussion :)
#10
This is really hard to solve with the current structure of uc_coupon, as it treats discounts against the whole order - it has no knowledge of which products they originally applied to and hence which tax rates should be applied to any discount (and mixing tax rates in a single coupon makes things even more complex!)
To fix this properly requires uc_coupon to switch to using price alterers and discount individual products rather than the whole order, but that will require a rewrite of large parts of the module :(
#11
hey there,
since it is a fundamental problem of the modul there is no workaround, right?
Has somebody an idea how this issue could be solved temporarily through other moduls or an adaptation of the existing one?
I would be glad for any advice on this issue!
Thank you very much!
Best, Simon
#12
On the cart page i get a drupal set message telling me the coupon was accepted and i saved £x.xx - this value is the 10% (in my case) off the product excluding the VAT tax.
I then go to checkout, and through to the confirmation page where the coupon discount is listed as 10% off the price that includes the VAT.
I don't care which price the 10% is given on, as long as it is consistent.
So would it be fine to simply remove the ability to show the discount saving in the message presented when a coupon is entered in the cart? Done in
function uc_cart_pane_coupon_submit($form, &$form_state) {#13
This solution worked for me:
Your Drupal site > Administer > Store administration > Configuration > Tax rates and settings > Edit a tax rate
Enable the option, Taxed line items: Coupon discount
Using module versions:
UC_VAT 6.x-1.1
UC_Coupon 6.x-1.4
#14
This will only work if your tax rate is the same for each product
Eg, we have paperback books and PDFs for sale, paperback books are 0% VAT, PDFs are classed as software so are 17.5% VAT.
#15
Your instructions didn't make any difference for me. On the cart page I get one price, on the checkout I get a different calculated price.
#16
@budda: that particular issue should now be fixed in CVS.
The mixed tax rate problem is still not solved, and as previously explained, it's a difficult one. In particular, if you are applying a fixed discount on products with mixed tax rates, how do you calculate VAT? This seems to depend on how you intend the discount to apply, and there's no way of specifying that at the moment - you would configure both "buy product 1 and get £10 off product 2" and "buy products 1 and 2 and get £10 off your total order" in the same way (fixed £10 discount using product restrictions) but the VAT calculations would be different for each case. For the second case in particular: does the £10 get split into £5 off each product, or do you apply it proportionally to the original prices?
#17
After a huge amount of work on both uc_coupon and uc_vat, I think this issue should now be solved, however it requires a small patch to uc_taxes to work correctly.
You need:
In testing, VAT appears to be applied correctly to all coupons, whether percentage or price based and whether they apply to individual products or the entire cart. If a price-based coupon is applied to the entire cart, it is treated by splitting the discount proportionally amongst the products.
Please test and report back in this thread, and I would also like #990744: uc_taxes does not respect hook_line_item_data_alter() to be marked as RTBC if this indeed does work correctly now.
#18
p.s. a code review of the changes to uc_vat would be nice, if anyone who cares about this issue has some time to do so; I realise that adding a "tax_adjustment" hook to line items is somewhat of a hack, but it's the only way I could see of doing this without basically rewriting the entire of Ubercart's price and tax handling systems.
#19
Also, whatever happened to the patch from Drupalcon that is mentioned in #3?
#20
The patch at Drupalcon was really just a hack to uc_taxes and didn't really fix the issue in the end.
#21
The code is in CVS and seems to be working well for me, but leaving as "needs review" for now as this is a fairly major issue.
#22
I have a similar problem, but for US rather than VAT. I configured a tax rate for my state, and marked the rate as applied to shippable products only, and taxed line items include products and coupon discounts.
A customer ordered one line item, which was a file download item and therefore not shippable, and not taxable. The coupon was applied to the order, and tax was credited to the order. So I have an order where tax was not charged for the single line item, but a credit was given for both the coupon and the tax rate for the coupon.
This seems to me like a variant of the problem discussed in this note, but it happens for non-VAT countries, too.
I tried both uc_coupon-6.x-1.5 and uc_coupon-6.x-1.x-dev, and also applied the uc_taxes patch pointed to in #17. I still get the tax credit on the coupon even though there is no tax on the order's single line item.
I attached a screen shot showing the order total preview.
#23
The solution I implemented works with uc_vat when mixed tax rates are in use, but not uc_taxes on its own, I'm afraid. It should be possible to add uc_taxes support somehow, but it's a case of finding time to do it.
#24
#25
Works with uc_taxes for 7.x-2.x