fix: Period list fixes in financial statements (#22677)

This commit is contained in:
Deepesh Garg 2020-07-15 12:17:43 +05:30 committed by GitHub
parent eb2a42d9e1
commit 5beac7a0cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ from __future__ import unicode_literals
import re
from past.builtins import cmp
import functools
import math
import frappe, erpnext
from erpnext.accounts.report.utils import get_currency, convert_to_presentation_currency
@ -45,10 +46,7 @@ def get_period_list(from_fiscal_year, to_fiscal_year, period_start_date, period_
start_date = year_start_date
months = get_months(year_start_date, year_end_date)
if (months // months_to_add) != (months / months_to_add):
months += months_to_add
for i in range(months // months_to_add):
for i in range(math.ceil(months / months_to_add)):
period = frappe._dict({
"from_date": start_date
})