From b9f9be3d8867c107f7c4ff5262b1043f2f11aa46 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 f57c070f80b..1d2c4d4f424 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -261,7 +261,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]