Purchase Invoice: Apply item-wise discount on the amount

Currently, ERPNext provides Rate-wise Discount and Additional Discount on the Purchase Invoice. However, there is no standard option to apply an item-wise discount amount directly to individual line items.

In many businesses, suppliers provide discounts on specific items as a fixed discount amount rather than as a percentage or a reduced rate. Therefore, ERPNext should support item-wise discount on the amount for each purchase invoice line.

This feature would allow users to enter a discount amount for each item, with the system automatically calculating the net rate, net amount, taxes, stock valuation, and accounting entries based on the discounted value.

I think you just need to add the fields to your view.

Clear the gear icon at top right of the item table, then choose “add/remove columns”. Add the interesting fields like Discount Amount.

I already tried this method. The discount is being applied to the rate instead of the amount. I need the discount to be applied to the line amount.

For example:

  • Item A rate: 100

  • Quantity: 3

  • Line amount: 300

I want to apply a discount of 10 to the line amount, so the calculation should be:

300 - 10 = 290

Instead of reducing the unit rate, the system should deduct the discount from the total line amount…

Is there any way to apply the discount to the item’s total amount ?

For this you’ll want to display Price List Rate in your print format and perhaps your Purchase Invoice view. This will keep the numbers displayed as you wish.

Is your issue a print/display issue or are you unhappy with the accounting ledger entries?

1 Like

My concern is with the accounting ledger entries, not the print format. I want to apply the discount to the item amount (line total) instead of the unit rate. This is important because I need to track the actual item cost, item-wise profit and loss, and profit margins accurately in the accounting ledger.

How do you propose this change? Will you add a second column called “final_total” (total_after_discount)?

Can you give an example of the inaccuracies of the current system? How is it negatively impacting profit margin accuracy? Where do you want the discount applied (offset customer balance, go to a special discount account in chart of accounts, etc)?

Sure, I’ll explain the current behavior and what I need.

Currently, the Purchase Invoice has two discount options:

1. Discount Amount (Item Level)
This discount is applied to the item rate, not the line amount.

Example:

  • Rate = ₹100

  • Quantity = 2

  • Discount Amount = ₹10

Current calculation:

  • New Rate = ₹100 - ₹10 = ₹90

  • Line Total = ₹90 × 2 = ₹180

This changes the unit cost of the item, which is not what I want.

2. Distributed Discount
This applies an additional discount to the entire invoice and distributes it across all items. It is not a direct item-level discount.

Neither of these options meets my requirement.

What I need:

I want the discount to be applied to the line amount, not the unit rate.

Example:

  • Rate = ₹100

  • Quantity = 2

  • Line Amount = ₹200

  • Discount = ₹10

Expected calculation:

  • Line Amount = ₹100 × 2 = ₹200

  • Discount = ₹10

  • Final Line Total = ₹190

The unit rate should remain ₹100, and only the line total should be reduced by the discount.

This is important because I need to maintain the original purchase rate while recording the supplier’s line discount separately. It provides a more accurate item cost, landed cost, profit margin, and item-wise profitability. Applying the discount to the unit rate changes the item’s cost, making cost and profit analysis less accurate.

Which account (chart of accounts) will be used to apply the discount?

This is not an accounting ledger or chart of accounts mapping issue. My concern is about the item cost calculation.

As I explained in my previous example, when the discount is applied to the unit rate, the item cost becomes different from what I expect.

Current behavior:

  • Rate = ₹100

  • Quantity = 2

  • Discount = ₹10

  • ERPNext calculates: (₹100 - ₹10) × 2 = ₹180

  • Therefore, the cost per item becomes ₹90.

Expected behavior:

  • Rate = ₹100

  • Quantity = 2

  • Line Amount = ₹100 × 2 = ₹200

  • Apply a ₹10 discount to the line amount

  • Final Line Amount = ₹190

  • Therefore, the effective cost per item becomes ₹95 (₹190 ÷ 2).

The difference of ₹5 per item directly affects the item’s valuation, cost, profit margin, and item-wise profitability.

So, my request is not about which ledger account should receive the discount. My request is to provide an option to apply the discount to the line amount instead of the unit rate, so that the item cost is calculated correctly.

this is a example of purchase invoice ..how can i enter this bill into erpnext purchase invoice with the same discount calculation

I disagree.

You want your 5 ITEMS of “Cat Litter 10L” to reflect a cost of 250, when it actually only cost you 230. The 20 needs to go somewhere to offset what you “really” paid vs what you’re claiming as cost.

Current Calculation :
Amount = (Rate − Discount) × Quantity

Expected Calculation:
Amount = (Rate × Quantity) − Discount

Ah,

That will require a customization, which will likely run into rounding issues.

You will need a custom field and custom scripts to work out the calculation.