chore: Add index to period closing voucher column
diff --git a/erpnext/accounts/doctype/closing_balance/closing_balance.json b/erpnext/accounts/doctype/closing_balance/closing_balance.json
index 37d26b8..ea6da14 100644
--- a/erpnext/accounts/doctype/closing_balance/closing_balance.json
+++ b/erpnext/accounts/doctype/closing_balance/closing_balance.json
@@ -116,7 +116,8 @@
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Period Closing Voucher",
- "options": "Period Closing Voucher"
+ "options": "Period Closing Voucher",
+ "search_index": 1
},
{
"default": "0",
@@ -128,7 +129,7 @@
"icon": "fa fa-list",
"in_create": 1,
"links": [],
- "modified": "2023-02-27 19:47:36.658224",
+ "modified": "2023-03-06 08:56:36.393237",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Closing Balance",
diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py
index 9d6f68d..db6b9dc 100644
--- a/erpnext/accounts/report/trial_balance/trial_balance.py
+++ b/erpnext/accounts/report/trial_balance/trial_balance.py
@@ -201,11 +201,12 @@
)
if doctype == "Closing Balance":
- opening_balance = opening_balance.where(closing_balance.closing_date < filters.from_date)
if period_closing_voucher:
opening_balance = opening_balance.where(
closing_balance.period_closing_voucher == period_closing_voucher
)
+ else:
+ opening_balance = opening_balance.where(closing_balance.closing_date < filters.from_date)
else:
opening_balance = opening_balance.where(closing_balance.posting_date < filters.from_date)