fix: Patch for posting closing balances (#35037)
diff --git a/erpnext/patches/v14_0/update_closing_balances.py b/erpnext/patches/v14_0/update_closing_balances.py
index 40a1851..f47e730 100644
--- a/erpnext/patches/v14_0/update_closing_balances.py
+++ b/erpnext/patches/v14_0/update_closing_balances.py
@@ -26,7 +26,15 @@
pcv_doc.year_start_date = get_fiscal_year(
pcv.posting_date, pcv.fiscal_year, company=pcv.company
)[1]
- gl_entries = pcv_doc.get_gl_entries()
+
+ gl_entries = frappe.db.get_all(
+ "GL Entry", filters={"voucher_no": pcv.name, "is_cancelled": 0}, fields=["*"]
+ )
+ for entry in gl_entries:
+ entry["is_period_closing_voucher_entry"] = 1
+ entry["closing_date"] = pcv_doc.posting_date
+ entry["period_closing_voucher"] = pcv_doc.name
+
closing_entries = pcv_doc.get_grouped_gl_entries(get_opening_entries=get_opening_entries)
make_closing_entries(gl_entries + closing_entries, voucher_name=pcv.name)
company_wise_order[pcv.company].append(pcv.posting_date)