fix: get period estimate till service end date

(cherry picked from commit a7ba7e9c28)
This commit is contained in:
venkat102
2024-10-18 18:00:40 +05:30
committed by Mergify
parent a05d6de2be
commit 35c257a7ae

View File

@@ -122,21 +122,24 @@ class Deferred_Item:
""" """
simulate future posting by creating dummy gl entries. starts from the last posting date. simulate future posting by creating dummy gl entries. starts from the last posting date.
""" """
if self.service_start_date != self.service_end_date: if (
if add_days(self.last_entry_date, 1) < self.period_list[-1].to_date: self.service_start_date != self.service_end_date
self.estimate_for_period_list = get_period_list( and add_days(self.last_entry_date, 1) < self.service_end_date
self.filters.from_fiscal_year, ):
self.filters.to_fiscal_year, self.estimate_for_period_list = get_period_list(
add_days(self.last_entry_date, 1), self.filters.from_fiscal_year,
self.period_list[-1].to_date, self.filters.to_fiscal_year,
"Date Range", add_days(self.last_entry_date, 1),
"Monthly", self.service_end_date,
company=self.filters.company, "Date Range",
) "Monthly",
for period in self.estimate_for_period_list: company=self.filters.company,
amount = self.calculate_amount(period.from_date, period.to_date) )
gle = self.make_dummy_gle(period.key, period.to_date, amount)
self.gle_entries.append(gle) for period in self.estimate_for_period_list:
amount = self.calculate_amount(period.from_date, period.to_date)
gle = self.make_dummy_gle(period.key, period.to_date, amount)
self.gle_entries.append(gle)
def calculate_item_revenue_expense_for_period(self): def calculate_item_revenue_expense_for_period(self):
""" """