Wrong discount calculation: 10 days later and still waiting a reply!

  • Posts: 41
  • Thank you received: 2
7 years 4 months ago #274284

I have also just discovered this flaw, my customer sells to both companies and individuals the requirement is for prices to be displayed excluding Tax (VAT). It is also a requirement that the discount is applied to the price before Tax (VAT) this appears to not be possible in Hikashop 3.

The only solution that is acceptable to my customer is to roll back to Hikashop 2.6 which isn't ideal for anyone. The only real solution I can see is that an extra configuration is added to the Taxes section of the configuration to apply Coupons before or after Tax.

If you were to provide this then it would solve this issue which has been identified as your current solution of changing the text displayed has been ruled unacceptable by my customer. I have to agree completely with them, they require a professional feeling website.

Please reconsider your decision not to provide the ability for your customers to configure coupons as would be expected before or after Tax.

Kind Regards,

Dave

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

  • Posts: 105
  • Thank you received: 6
  • Hikashop Business
7 years 4 months ago #274303

Twincarb wrote: If you were to provide this then it would solve this issue which has been identified as your current solution of changing the text displayed has been ruled unacceptable by my customer. I have to agree completely with them, they require a professional feeling website.


Dave,
According to Nicolas, these requests we are making are polluting their forum !!
If you are wondering what I am talking about, please read his 'kind' reply at the end of this thread:
www.hikashop.com/support/forum/checkout/...html?start=20#274302

Nicolas: yesterday, when I read Dave's post, I had the hope that you will at last realize there is a serious problem. Instead I received a disgraceful reply from you in another post, where another user from Portugal reported the same problems. I am really sorry for you. You should behave yourself, you are talking to customers. And when you have many customers reporting the same problem, instead of insulting them you need to understand that you must find a solution. One that works.

Panos (a seller who's been kindly serving his customers for 12 years)

Last edit: 7 years 4 months ago by panefs.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 4 months ago #274364

Hi,

Seeing Dave's post, it indeed looks like there is something to look deeper into.
And I want to look deeper into it.
I wasn't insulting you and that wasn't my goal. I was just asking you to stay on topic. You, however, insulted us.
But let's stop talking about that and please stay on topic.

To go back to the issue from what I understand of this whole tax topic, the calculations are correct provided that the coupons and HikaShop are configured properly. The only thing you have a problem with is that the coupon value is displayed on the checkout cart view includes the taxes.

Is that correct for both of you ?
I looked at this thread messages but I don't see the same situation on my end.
So already I'm not able to reproduce the problem: monosnap.com/file/v0i03nfpaZRT12GilnLhf1BmLSTDLp
The coupon value looks fine to me based on your example fo 33.33% coupon on a 36.90€ sub total including a tax of 24%

Please provide a precise example with all the necessary details to be able for us to reproduce :
- how is configured the "discount apply" value
- a screenshot of the settings of the coupon
- the amount of your tax rule
- the price of the product without taxes as entered in the backend
- a screenshot of the result on the checkout with the issue
- if possible the screenshot of the result on the checkout before the update for the exact same situation

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

  • Posts: 105
  • Thank you received: 6
  • Hikashop Business
7 years 4 months ago #274377

Just a moment, I can't let this passed unanswered.
I never insulted you. Point me to a single post of mine, where I did so. For months I've been trying to tell you what you just accepted: that there is a flaw in Hikashop 3. And how did you treat me? You called my posts a pollution to your forums!
You have insulted me, and you did it in a very disgraceful way. You know, saying "I am sorry" is not a bad thing, sometimes.
After all you are not talking to kids, you are talking to customers.

EDIT: Although I feel very offended, I'll try to get back to you with the required information, in the hope this problem gets resolved.

Last edit: 7 years 4 months ago by panefs.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 4 months ago #274409

Hi,

My wording was maybe strong regarding the word "polluting" and I'm sorry, but that wasn't insulting you, that was towards your action and as I already said, I actually didn't mean it in an insulting way.
However your words "your majesty" are directly directed to myself. I also feel very offended by your words...

Now please let's stop off topic messages, for the third time, and focus on the issue at hand.

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

  • Posts: 105
  • Thank you received: 6
  • Hikashop Business
7 years 4 months ago #274455

I apologize for my phrase, too.
I will create a copy of my site on a subdomain where I will install Hikashop 3 (I re-installed Hikashop 2 on my live site, because it calculates correctly the coupon discounts). I will then get back to you.

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 4 months ago #274456

Hello,

Nicolas will be traveling during one week but he asked me to personally investigate that coupon problem.
Regarding one of your previous screenshot, I can see that the total stay correct but the displayed discount value includes taxes (discount without taxes is "12.30" by adding 24%, you got 12.3*1.24 = 15.25).

So, I think your issue is related to a fix included in HikaShop 3 in order to handle specific cases (in Netherlands).
See related thread : www.hikashop.com/forum/taxes/888957-discount-on-vat.html
Now, I got the impression that a patch have an unwanted side effect for you because I think that you have configured a tax category for your percentage coupon while you don't want that.

Before your coupon is processed before the tax it should not have a tax category set and I think that HikaShop 2.6.x was not using that value while HikaShop 3 can authorize it even if it can cause wrong display for some cases.

In order to perform the rest of the investigation, I will need some precise details.
The first one would be the entire configuration of the coupon you are using (I can't find it in that thread).
I would also require some details about your tax configuration and a sample case to reproduce it in my side.
- HikaShop setting about taxes and discounts.
- The test coupon configuration
- Tax rules
- A sample product configuration
- An user address

Thanks to that I will be able to test and confirm my hypothesis ; compare it with the other reported issues (like the thread I mentioned previously) in order to find what should be modified in HikaShop and what kind of warning we should add if the system detects special configuration settings.

In the same time, if your coupon setting is using a tax category as I though, I would welcome you to perform a little test in an HikaShop 3 website without that tax category.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 41
  • Thank you received: 2
7 years 4 months ago #274490

Jerome, it does appear that the linked thread is very similar in the configuration doesn't appear to work as expected.
I have taken screen shots of the items you have requested, additionally, I have taken a screen shot when I changed the setting "Product Tax Category" to "None" & set "Apply Discounts" to "After Tax" This setting seems counter intuitive to me although this does apply the correct discount to the cart.
Although this leaves the Tax being charged too high, and thus the total is now too high.

Below is the setup as I had it originally and the result that is shown in the cart. I have noted what the correct calculations should be.



The Tax zone is set to the United Kingdom, which for most items is set to 20%, there are 0% items that are available for sale which I haven't tested yet to see how it would be applied.


This is the setup of the Coupon I also changed the Product Tax Category to None which had no change until I changed the global "Apply Discounts - After Tax"


This is the default Tax Rule, as can be seen, the zone is set to the United Kingdom.


This is the setup for a product which is a sub-category to the one which is selected in the Apply Discount to setting.



Below is the result of changing the details as suggested in the other thread, I have added notes to the image.


If you would like any more details please let me know and I shall update this thread.

Regards,

Dave

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

  • Posts: 105
  • Thank you received: 6
  • Hikashop Business
7 years 4 months ago #274492

Jerome,
No matter the "Product Tax Category" I select in the coupon settings, Hikashop 3 keeps calculating the discount with the VAT included.
The following image shows the problem.
In this case I created a 50% coupon and added it to a product that costs € 64.
The 50% discount should therefore have been € 32 euros:



As I mentioned before, I had to install Hikashop 2 on my live site, to avoid confusing my customers.
For the purposes of re-testing Hikashop 3 as per your request, I created a duplicate of my site that I installed on a subdomain. If you wish, I can send you the admin access so that you check the coupon settings, and everything else. Would it be OK to send you this information at info-at-hikashop.com ?

Tx
Panos

Attachments:

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

  • Posts: 41
  • Thank you received: 2
7 years 4 months ago #274493

Panos,
It's counter intuitive, but in the global settings change the Apply Discounts to After Tax, and in the coupon set the tax to "none" I am sure that those combinations shouldn't "almost" work. But as per my last screen shot the Coupon is applied correctly. However, the Tax (VAT) isn't then applied correctly.

Regards,

Dave

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

  • Posts: 105
  • Thank you received: 6
  • Hikashop Business
7 years 4 months ago #274494

Hi Dave,

I just changed the global & coupon settings, as per your suggestion. I encountered the same problem you described:
the discount was calculated accurately this time, but the amount of the VAT applied was wrong.

Regards
Panos

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 4 months ago #274515

Hello

@Twincarb - thanks, I will reproduce your configuration in my side and perform some analysis.
I can see that you have some category restriction on your coupon and that your product is a variant. It could be a useful clue regarding the past patches in the discount system.

@panefs - Okay but I'm sorry right now it does not help.
I'm asking for elements to be able to work on in a controlled website environnement where I can edit easily and fast files to find the issue. Unfortunately you do not provide such information (I don't need sentences, I needed screenshot in order to get all settings even if these screenshot are from HikaShop 2, the settings are still the same !).
I'm glad that Twincarb give it so we will be able to move forward now.

I'll keep you posted for my progresses.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 4 months ago #274525

Hello,

I detected an issue related to the thread I mentioned in a previous message :
www.hikashop.com/forum/taxes/888957-discount-on-vat.html

You do not know that and very few people does, but when a discount have a "percentage" value but is applied on specific products, HikaShop is converting the coupon into a flat amount coupon.
The HikaShop coupon algorithm support flat amount and full percentage ; so when the percentage is not on the full cart it has to be converted.

Due to the patch that Nicolas made in the other thread, that conversion is forced to read the prices with taxes.
I think the patch should be modified in order to be more specific and less "open".
So in the file "administrator/components/com_hikashop/classes/discount.php" you have to replace

if(!empty($coupon->discount_tax_id) || $config->get('discount_before_tax', 1)){
By
if(!empty($coupon->discount_tax_id) && !$config->get('discount_before_tax', 1)) {

In the same time, I will write a full report to Nicolas in order to integrate the patch into HikaShop packages and perform some other modifications.
A part of the current coupon system has been made by Brainforge and because the coding style is not the same ; the implementation is not what we would have done in our end and it makes the support of these features more difficult for the team.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 41
  • Thank you received: 2
7 years 4 months ago #274536

Hi Jerome,

Thanks for looking into the coding on a Sunday! I will make the change you suggest shortly and let you know what my results are.

Regards,

Dave

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

  • Posts: 41
  • Thank you received: 2
7 years 4 months ago #274542

@Panos,

For your information, the line that needs changing is 424 in "administrator/components/com_hikashop/classes/discount.php"

@Jerome,

Please see below the results that I had once I applied the change to the above reference file.

The first check was keeping the Taxes setting in the global configuration as below. As can be seen in the second image the VAT (Tax) and Total amounts is still incorrect. (Coupon settings at this point are Product Tax Category = None & Categories are in place.






In global config, I changed Apply Discounts before Taxes (This is the logical setting) As can be then seen the Coupon in calculated correctly the VAT(Tax) is correct but the total is incorrect!






continued on next message...

Attachments:
Last edit: 7 years 4 months ago by Twincarb.

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

  • Posts: 41
  • Thank you received: 2
7 years 4 months ago #274543

Next, I went into Coupon settings and Removed the limitation on the categories (This is far from ideal for the live system as the coupon should only be valid for certain categories.) Again the total amount is incorrect however the other details are as expected.




I then changed the "Product tax category" from None to Default tax category and kept no limit to any category. This resulted in the correct details showing in the cart.



continued in next message...

Attachments:

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

  • Posts: 41
  • Thank you received: 2
7 years 4 months ago #274544

****Working Configuration****
Final check was to add the category restrictions back into place and the result remained the same, I have included the Taxes configuration as well so all the settings are able to be seen









@Jerome, Thank you for your efforts this weekend it would appear we have a working solution and configuration which is logical.

@Panos, I hope your able to follow the final settings that I used and are able to confirm your success as well.

Kind Regards,

Dave

Attachments:
Last edit: 7 years 4 months ago by Twincarb.
The following user(s) said Thank You: Jerome

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

Time to create page: 0.177 seconds
Powered by Kunena Forum