chore: Add index to period closing voucher column

This commit is contained in:
Deepesh Garg 2023-03-06 16:56:33 +05:30
parent 310f71c313
commit 5dabc98ba5
2 changed files with 5 additions and 3 deletions

View File

@ -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",

View File

@ -201,11 +201,12 @@ def get_opening_balance(
)
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)