From 58ca4a2b99a694ea891e1b3cfd949f799edacafb Mon Sep 17 00:00:00 2001 From: ljain112 Date: Wed, 18 Sep 2024 19:38:14 +0530 Subject: [PATCH] fix: improved the conditions for determining voucher subtypes (cherry picked from commit 00eee161904b5deb01ba80b6a3629bd7e2dd613f) --- erpnext/controllers/accounts_controller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index e47e9917149..b14cf428c53 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1096,9 +1096,11 @@ class AccountsController(TransactionBase): return "Purchase Return" elif self.doctype == "Delivery Note" and self.is_return: return "Sales Return" - elif (self.doctype == "Sales Invoice" and self.is_return) or self.doctype == "Purchase Invoice": + elif self.doctype == "Sales Invoice" and self.is_return: return "Credit Note" - elif (self.doctype == "Purchase Invoice" and self.is_return) or self.doctype == "Sales Invoice": + elif self.doctype == "Sales Invoice" and self.is_debit_note: + return "Debit Note" + elif self.doctype == "Purchase Invoice" and self.is_return: return "Debit Note" return self.doctype