Developer forum

Forum » Ecommerce - Standard features » Apply discount before taxes

Apply discount before taxes

Mario Santos
Mario Santos
Reply

Hello,

The Order discounts setting "Apply discount before taxes" does not seem to be taking into consideration while calculating taxes. It seems that the tax value is always calculated based on products before discounts. Here's a screencast to demo the issue: https://www.screencast.com/t/qdyyFUFU

DW: 9.7.2

Thanks
BR, Mario

Replies

 
Oleg Rodionov
Oleg Rodionov
Reply

Hi Mario,

Meaning of the feature - use the order total without tax by a discount-Total Price-Total price condition if "Apply discount before taxes" is enabled. I've tested the feature on DW9.7.2 and had correct results - proof.

BR, Oleg QA 

 
Mario Santos
Mario Santos
Reply

Hi Oleg,

Thanks for sharing the feature and your screencast. Although, this thread wasn't related to it, since we are not setting a discount over order $ amount.

Using an example of an order with just one product that costs $20, and there is a 10% discount and tax value of 10%: https://www.screencast.com/t/Ohh7zBnVB

  Tax before discounts Tax after discounts
Product $ 20 $ 20
Discount (10%) $ 2.20 $ 2.00
Tax (10%) $ 2.00 $ 1.80
     
Total $ 19.80  $ 19.80

The order total amount should be the same. As you can see in the screencast, it is when the discount is an Order Discount even with the discount and tax values not matching exactly the example. When we change the discount to Product Discount, we get different order total values, causing the discount/taxes relation to be incorrect.

BR, Mario

 

 

 
Oleg Rodionov
Oleg Rodionov
Reply

Hi Mario,

I see your video shows the same results in orderline/total calculation with the option is enabled or disabled. What's wrong? It says that the option does not afect the calculation until amount in discount-'Total price' fied is used. It is expected behavior.

BR, Oleg

 
Nuno Aguiar
Nuno Aguiar
Reply

Hi Oleg,

 

Allow me to jump in. The problem is how the Tax is calculated with a Product Discount. Notice that the tax and discount amounts are different when Discount type is Product vs Order. This becomes an issue for accounting after the order is integrated with the ERP.

 

So despite the total amount being the same (in Mario's example 19.80), the tax changes from 1.80 to 2.00 (and the discount amount also changes of course), and this is the issue. In case you are wondering, the correct behaviour is Order Discount. The Product discount needs to be fixed.

 

Does that make sense?

 

Best Regards,

Nuno Aguiar

 
Oleg Rodionov
Oleg Rodionov
Reply

Hi Nuno,

I'll have a look in the difference during calculation order vs. order line tax (I'm not sure it's bug but not feature as well) but I cannot understande why the topic was started with other issue related to "Apply discount before taxes" option, can you say? Mario has described a calculation above with/without the option enabled (see column's titles), where it occurs - what's existing DW version?

BR, Oleg QA  

 
Nuno Aguiar
Nuno Aguiar
Reply

Hi Oleg,

 

The topic started like that as a misinterpretation of the actual source of th problem and we only noticed it after you could not reproduce the problem, which caused us to look deeper. So we're sorry for that and at the same time, good job (for you smiley ).

 

This happens in 9.6.11 (the customer who's reporting the error), but seems to be the same in 9.7 as well.

 

Thanks for looking into it again,

Nuno Aguiar

 
Oleg Rodionov
Oleg Rodionov
Reply

Hi,

OK, but can you point DW version where the calculation is correct (order vs order line discount ) with the same conditions in your view? Thanks in advance.

BR, Oleg QA

 
Nuno Aguiar
Nuno Aguiar
Reply

Hi Oleg,

 

Sorry if that was not explicit.

  • The calculation is accurate with Discout type = Order discount in 9.6.11
  • The calculation is wrong with Discount type = Product discount in 9.6.11

 

Best Regards,

Nuno Aguiar

 
Oleg Rodionov
Oleg Rodionov
Reply

Hi,

Yup, I see 9.6.11 has issue per your comment but what's DW [previous] version where the calculations are performed OK (without the bug=order total is the same), you can point?

BR, Oleg QA  

 
Nuno Aguiar
Nuno Aguiar
Reply

Hi Oleg,

 

I see what you mean. I know that when the feature of "Apply discount before taxes" was introduced it was working properly. A customer of ours has them in 9.4.11 (production) and their qa environment is in 9.4.15.

 

Here is proof that the Taxes don't change with a test discount of 90% in 9.4.15 

 

Best Regards,

Nuno Aguiar

 

 

 
Oleg Rodionov
Oleg Rodionov
Reply
This post has been marked as an answer

Hi all,

I've created new TFS 72050 against wrong tax price calculation when discount is applied as 'Product discount'. Thanks for observing.

BR, Oleg QA   

Votes for this answer: 1

 

You must be logged in to post in the forum