Screenshot 2023-10-25 at 10.48.41 PM.png
Flat Discount
Implementing Flat Discount in ERPNext


Akhilesh Darjee


Jan, 2 2014



min read

Wishing you a Happy New Year 2014…!!!

With New Year ERPNext comes with one more new feature – Flat Discount. Anand is working on Permission Manager, Rushabh and Pratik on ERPNext Appify, Priya working hard on eBooks introducing ERPNext, while Nabin and I were assigned to implement Flat Discount. Thanks to our customer Robert who motivated us to get it done.

Flat Discount means final discount given by a seller on grand total, mostly for the purpose of rounding off. In ERPNext, the Flat Discount is applied on both Item as well as Taxes. Currently, the Flat Discount is available on all selling transactions. You can define an actual amount to be discounted in “Flat Discount” field.

We gave it a first try in October, completed the project, but the logic we implemented limited us to apply flat discount only on item amount, which resulted in the customer paying more taxes. This condition was not fair from Customer’s view-point. So we decided to postpone the project, and give it a more deep thought the next time we implement it.

After a month, we gave it a second try but with a new model which contains -

  1. Apply Flat Discount on both item amount and taxes.

  2. No Flat Discount on Actual taxes.

  3. Distribution of the Flat Discount will be done as per particular’s contribution to the grand total.

How Flat Discount actually works?

  1. Firstly, get the Grand Total for Flat Discount i.e. Grand Total excluding sum of all Actual taxes.

    Grand Total For Flat Discount = Grand Total - Sum of Actual Taxes

    430 – 100 = 330.

  1. The Flat Discount will be distributed proportionally as per formula:

    Amount after Flat Discount = Amount – (Amount * Flat Discount / Grand Total for Flat Discount)

    For Item "2301" : 100 – (100 * 10 / 330) = 96.97

    For Item "5302" : 200 – (200 * 10 / 330) = 193.94

  1. Now all taxes will be re-calculated on the basis of “Amount after Flat Discount” except Actual Tax, which will lead to discount on tax as well.

    NOTE : Tax Amount after Flat Discount is not calculated for Actual taxes as it is not included under Flat Discount.

The improved flat discount version will allow the customers to get discount not just on the product but also on the tax which they would have paid otherwise on the whole product amount.

Published by

Akhilesh Darjee


Jan, 2 2014


Add your comment






July 26, 2020

Hello, Thanks, very informative. I have some questions , if you have free time care to answer. It said Grand Total For Flat Discount = Grand Total - Sum of Actual Taxes= 430 – 100 = 330.

But how sum of actual taxes is 100 ? and how Grand Total is 420 at the end in sheet. thanks



Paul Mugambi


3 days


Beautiful read, and an insight into an individual I respect and have learned a lot from. Am inspired to trust the process and never give up.


Anna Dane


5 days


I must say this is a really amazing post, and for some of my friends who provide Best British Assignment Help, I must recommend this post to them.

Add your comment