fix: account setting seperation gl discount account creation
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 8558cea..78645e0 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -1079,9 +1079,14 @@
return amount, base_amount
def make_discount_gl_entries(self, gl_entries):
- enable_discount_accounting = cint(
- frappe.db.get_single_value("Selling Settings", "enable_discount_accounting")
- )
+ if self.doctype == "Purchase Invoice":
+ enable_discount_accounting = cint(
+ frappe.db.get_single_value("Buying Settings", "enable_discount_accounting")
+ )
+ elif self.doctype == "Sales Invoice":
+ enable_discount_accounting = cint(
+ frappe.db.get_single_value("Selling Settings", "enable_discount_accounting")
+ )
if enable_discount_accounting:
if self.doctype == "Purchase Invoice":