From 82b613353bfcbfbcb436aec847986cb1773c74bc Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Wed, 20 Mar 2024 18:45:04 +0530 Subject: [PATCH] fix: validate gl for previous fiscal year (cherry picked from commit a1d108c062831b2301b2b62b09dad35e8bbd1959) --- .../doctype/period_closing_voucher/period_closing_voucher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index 674db6c2e43..88a2ca575ac 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -121,7 +121,8 @@ class PeriodClosingVoucher(AccountsController): previous_fiscal_year = get_fiscal_year(last_year_closing, company=self.company, boolean=True) if previous_fiscal_year and not frappe.db.exists( - "GL Entry", {"posting_date": ("<=", last_year_closing), "company": self.company} + "GL Entry", + {"posting_date": ("<=", last_year_closing), "company": self.company, "is_cancelled": 0}, ): return