Hi Everyone,
We are facing an accounting issue in ERPNext v15.65.2 and would like to understand whether this is expected behavior or if we have a configuration issue.
Environment
-
ERPNext: 15.65.2
-
Frappe: 15.71.0
Scenario
We have line-item discounts on Sales Invoices.
Example:
| Item | Selling Price | Discount | Final Amount |
|---|---|---|---|
| Administration Charges | 4000.00 | 2762.71 | 1237.29 |
| Labour Charges | 4584.74 | 3000.00 | 1584.74 |
The Sales Invoice values are correct:
-
Net Total = ₹9,830.74
-
Grand Total = ₹11,600.28
The Sales Invoice Item also stores the correct values:
-
amount = net_amount -
base_amount = base_net_amount
Issue
However, the generated GL Entry is:
Dr Debtors 11,600.00
Cr Sales 15,593.45
Cr Output Tax 1,769.54
Dr Cost of Goods Sold 5,762.71
The Sales account is credited with ₹15,593.45 instead of the invoice net amount ₹9,830.74.
The difference (₹5,762.71) is exactly equal to the total line-item discount.
Investigation Done
- No custom Server Scripts.
No custom override of Sales Invoice.
Invoice data is correct.
doc.get_gl_entries()itself generates the above GL.
Enable Discount Accountingis enabled.
We found that all discounted invoice items have:
Income Account : Sales - MEL
Discount Account : Cost of Goods Sold - MEL
Expense Account : Cost of Goods Sold - MEL
There are 1189 Sales Invoice Items with:
discount_account = Cost of Goods Sold - MEL
We also checked get_default_discount_account() and it currently returns None, so we are not sure how these values were originally populated.
Questions
-
Is this expected behavior when Enable Discount Accounting is enabled?
-
Should the Sales account show Gross Sales and the discount be posted separately?
-
Should
discount_accountever point to Cost of Goods Sold, or should it be a dedicated Discount Allowed / Sales Discount account? -
Could this explain why our Sales ledger is higher than the Net Sales shown in our accounting system (Tally)?
Any guidance would be greatly appreciated.
Thank you!