From 4ada5a488ebee75c3286af5c9492ea53274730c4 Mon Sep 17 00:00:00 2001 From: vr-greycube <66350441+vr-greycube@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:38:32 +0530 Subject: [PATCH] fix: Use default Cost Center of the Company for additional discount (#37234) fix: Set cost center as default company cost center When Discount Accounting in enabled in Selling Settings, use Company default Cost Center while making GL entries for additional_discount_account --- erpnext/controllers/accounts_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 6efa09bb99..6812940ee2 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1491,7 +1491,7 @@ class AccountsController(TransactionBase): "account": self.additional_discount_account, "against": supplier_or_customer, dr_or_cr: self.base_discount_amount, - "cost_center": self.cost_center, + "cost_center": self.cost_center or erpnext.get_default_cost_center(self.company), }, item=self, )