From 3fb5d835f2259bca7becb3bb1bf899a8ffc77e95 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 9 May 2025 16:33:38 +0530 Subject: [PATCH] refactor: validate budget on cancel as well --- erpnext/accounts/general_ledger.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 4f5fe0c4023..6d123308a6d 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -33,6 +33,10 @@ def make_gl_entries( from_repost=False, ): if gl_map: + if gl_map[0].voucher_type != "Period Closing Voucher": + bud_val = BudgetValidation(gl_map=gl_map) + bud_val.validate() + if not cancel: make_acc_dimensions_offsetting_entry(gl_map) validate_accounting_period(gl_map) @@ -40,9 +44,6 @@ def make_gl_entries( gl_map = process_gl_map(gl_map, merge_entries, from_repost=from_repost) if gl_map and len(gl_map) > 1: if gl_map[0].voucher_type != "Period Closing Voucher": - bud_val = BudgetValidation(gl_map=gl_map) - bud_val.validate() - create_payment_ledger_entry( gl_map, cancel=0,