Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Period list for exponential smoothing forecasting report #24982

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion erpnext/accounts/report/financial_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def get_period_list(from_fiscal_year, to_fiscal_year, period_start_date, period_
"from_date": start_date
})

to_date = add_months(start_date, months_to_add)
if i==0 and filter_based_on == 'Date Range':
to_date = add_months(get_first_day(start_date), months_to_add)
else:
to_date = add_months(start_date, months_to_add)

start_date = to_date

# Subtract one day from to_date, as it may be first day in next fiscal year or month
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def prepare_periodical_data(self):

from_date = add_years(self.filters.from_date, cint(self.filters.no_of_years) * -1)
self.period_list = get_period_list(from_date, self.filters.to_date,
from_date, self.filters.to_date, None, self.filters.periodicity, ignore_fiscal_year=True)
from_date, self.filters.to_date, "Date Range", self.filters.periodicity, ignore_fiscal_year=True)

order_data = self.get_data_for_forecast() or []

Expand Down