From 26503a205f07a80f124c3dc5a59c039ed8ea708b Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 25 Sep 2023 10:39:39 +0530 Subject: [PATCH] refactor: simplify DFS --- .../bisect_accounting_statements.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.py b/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.py index 6be28c87bc..73a9e71960 100644 --- a/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.py +++ b/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.py @@ -21,9 +21,7 @@ class BisectAccountingStatements(Document): continue cur_floor = floor(delta.days / 2) - next_to_date = cur_frm_date + relativedelta(days=+cur_floor) - left = (cur_frm_date, next_to_date) + left = (cur_frm_date, (cur_frm_date + relativedelta(days=+cur_floor))) + right = ((cur_frm_date + relativedelta(days=+(cur_floor + 1))), cur_to_date) period_list.append(left) - next_frm_date = cur_frm_date + relativedelta(days=+(cur_floor + 1)) - right = (next_frm_date, cur_to_date) period_list.append(right)