From f2c4baeb0e1e982342099e4a2fca9a6737952575 Mon Sep 17 00:00:00 2001 From: l0gesh29 Date: Fri, 29 Aug 2025 16:30:29 +0530 Subject: [PATCH] fix: add is_cancelled in condition (cherry picked from commit 77a9cf639857b8e274d9c5adcaabd084d1524c7b) --- erpnext/accounts/doctype/gl_entry/gl_entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 2e4f9db3539..37ac27f3722 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -311,7 +311,7 @@ def validate_balance_type(account, adv_adj=False): if balance_must_be: balance = frappe.db.sql( """select sum(debit) - sum(credit) - from `tabGL Entry` where account = %s""", + from `tabGL Entry` where is_cancelled = 0 and account = %s""", account, )[0][0]