Interesting difference in how coupons are applied in combination with taxes

  • Posts: 329
  • Thank you received: 94
7 years 7 months ago #267655

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.5

We've been doing some testing of different coupon options and their effect on taxes, and found something curious. We're wondering if it's this way on purpose or if it's a bug (or undocumented "feature", lol)

If you leave everything the same in our settings and our coupons (which are overall coupons, not product specific) and we ONLY change the type of coupon from a % off coupon to a flat rate ($ amount off), how the coupon is applied to the products for taxable and non-taxable items is very different. Let's pretend the tax rate is 7%

Let's say we have 2 items in our cart.
- A taxable item for $300
- A non-taxable item for $110
Total in cart = $410

If we use a coupon for 25% off, taxes are applied to the following net prices:
- Taxable item = $300 - 25% off = $225. With a tax rate of 7%, this = $15.75 in taxes
- Non taxable item = $110 - 25% off = $82.50 non-taxable

If we use a coupon for the same amount but as a flat rate of $102.50 off, taxes are applied this way:
- Taxable item = $300 - $197.50 = $. With a tax rate of 7%, this = $13.83 in taxes
- Non taxable item remains $110 (the entire flat rate coupon gets applied preferentially to the taxed item first)

While I can see the benefit to the customer of reducing their taxable item(s) first to save them money, technically this is not correct (when the coupon is "overall" and not for the taxed item(s) only)

The amount of a flat rate coupon should instead be applied proportionately, like this:
- The Taxable item is 73.17% of the total order value. So the coupon should be applied as $300 - ($102.50 X 73.17%) = $300 -$75 off = $225 x 7% tax = $15.75 in taxes
- The non-taxable item represents 26.83% of the total order value. So the remaining coupon amount should be applied to this item.

As you can see, the way HikaShop is applying taxes for flat rate coupons is artificially reducing the taxes collected by applying the full value of the coupon against the taxable item(s) first. Technically this is incorrect (at least in the states!) and could lead to the store owner being audited and responsible for paying the difference of the uncollected taxes.

Is HikaShop doing this on purpose, or is this a bug?


~ Deb Cinkus, CEO

Polished Geek: more with monday․com
eCommerce Business Process Automation Experts

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
7 years 7 months ago #267661

Hi,

There were indeed inconsistencies in some cases with the coupons and the taxes calculations.
We've actually worked on that with HikaShop 3 and I believe that it should be more consistent now if you test with the 3.0.1.

Please Log in or Create an account to join the conversation.

  • Posts: 165
  • Thank you received: 3
7 years 7 months ago #267689

Hi, Nicolas I am in the exact same situation. I have a cart that has quite a bit of modifications on version 2.6.4 and some 3rd party extensions that are not quite ready for version 3 of the cart. Is there a way to get a patch to fix these tax issues on version 2.6.4? I know I need to upgrade to version 3.0.1 however, the client is going to have a large sale starting in May and the tax is calculating incorrectly and it is currently impossible to upgrade the cart to version 3.0.1 because it would take to long to do this.


Thanks,

Josh

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
7 years 7 months ago #267704

Hi,

The code being quite different between 2.6.x and 3.x, it's complex to provide patches and garantee that it will fix the issues without breaking other things.
I've had a look on my end, and the patch I found modify the function recalculateDiscountValue(&$coupon, &$products, &$id) in the file administrator/components/com_hikashop/classes/discount.php which fixes the calculation of the percentage coupons in some cases.
So as far as I can see, the handling of the coupons with a fixed value didn't change.

Now, regarding the flat rate coupons and the taxes: HikaShop adds the coupon to the total amount of the cart, and not "per product".
In the coupon settings you can configure the tax category to use for the calculation of the taxes to remove off of the taxes when the coupon is applied. So whether you have taxes or not or different taxes on the products in the cart, the coupon value and its tax amount will always be the same.
At least, that's how the system works for now.
Having it calculate the taxes of the coupon proportionally to the taxes of the products would require doing some additional calculations. That's not impossible, but it's not implemented.
I think it would have to be done in the addCoupon function of administrator/components/com_hikashop/classes/currency.php so if you feel like debugging a bit and adding your algorithm there so that it works properly in your case, we'll be happy to integrate back the modifications.

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum