fix: account setting seperation gl discount account creation

This commit is contained in:
rahib-hassan 2022-04-20 16:01:12 +05:30
parent f058755ad3
commit f3fa6ac4c2

View File

@ -1079,9 +1079,14 @@ class AccountsController(TransactionBase):
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":