How to handle deferred sales income and deferred discount separately on monthly schedules?

We have a use case where an invoice needs to defer both the sales income and the discount over multiple months,

For example, on an invoice dated August 1, 2026:

  • Deferred Sales Income: 840,000 total across a 3-month term ($280,000 / month).

  • Deferred Discount: 150,000 total across the same 3-month term ($50,000 / month).

At the end of each month, the accounting entry should independently recognize:

  • Recognized Income: 280,000

  • Recognized Discount: 50,000

What We Have Tried:

1.Global Discount:When applying a discount, ERPNext automatically nets it against the item value ($840,000 - $150,000 = $690,000 total) and defers the combined net amount ($230,000/month). Because of this, we cannot separately observe the gross income and the discount on a monthly basis.

2.Line Item Level Discount (Negative Value): We tried adding the discount as a separate line item using a negative value with “Enable Deferred Revenue” checked. However, it does not defer at all—in the very first month, it dumps the full amount (150,000) instead of splitting it across the 3 months (50,000/month).

3.Credit Notes: We also tested using a Credit Note since it allows negative quantities/amounts, but it suffers from the exact same issue as the line item level approach—it fails to defer the discount across the schedule at all.

Any guidance or standard implementation patterns would be greatly appreciated! ERPNext Version is 15.

Is a Server Script the only way to solve this, or is there a standard workaround/best practice in Frappe/ERPNext to achieve separate monthly deferred schedules for discounts?

@Ricky103
Have you tried to add a new row in the sales taxes and charges? And map the discount account in Account Head field then you will get the breakdown of both income and discount account in the ledger.

@Safvan_PhYes, I have already tried that approach using a row in Sales Taxes and Charges mapped to a discount account head.

Unfortunately, that method results in the exact same issue as methods #2 and #3: it fails to create a deferred schedule for the tax/charge row. Instead of splitting the amount across the 3 months ($50,000/month), it dumps the full discount amount ($150,000) into the ledger immediately in the very first month rather than matching the monthly deferred income breakdown.

The point is that while ERPNext’s default deferred income mechanism works perfectly for positive line items, it fails entirely when handling negative amounts intended to act as deferred discounts on a sales invoice.