From e483b4a78a260629e994eb2e0a36a59b96919288 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 (cherry picked from commit 4ada5a488ebee75c3286af5c9492ea53274730c4) --- 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 bd2354e7452..c7e21638bc7 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1406,7 +1406,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, )