(refactor) removed unnecessary code

This commit is contained in:
Mangesh-Khairnar 2019-01-04 13:17:31 +05:30
parent 8e47a543f6
commit 676a106d7a

View File

@ -40,7 +40,7 @@ class Analytics(object):
"fieldtype": "Data",
"width": 140
})
for dummy, end_date in self.periodic_daterange:
for end_date in self.periodic_daterange:
period = self.get_period(end_date)
self.columns.append({
"label": _(period),
@ -169,7 +169,7 @@ class Analytics(object):
"entity_name": self.entity_names.get(entity)
}
total = 0
for dummy, end_date in self.periodic_daterange:
for end_date in self.periodic_daterange:
period = self.get_period(end_date)
amount = flt(period_data.get(period, 0.0))
row[scrub(period)] = amount
@ -188,7 +188,7 @@ class Analytics(object):
"indent": self.depth_map.get(d.name)
}
total = 0
for dummy, end_date in self.periodic_daterange:
for end_date in self.periodic_daterange:
period = self.get_period(end_date)
amount = flt(self.entity_periodic_data.get(d.name, {}).get(period, 0.0))
row[scrub(period)] = amount
@ -243,8 +243,8 @@ class Analytics(object):
if period_end_date > to_date:
period_end_date = to_date
self.periodic_daterange.append([from_date, period_end_date])
self.periodic_daterange.append(period_end_date)
from_date = period_end_date + relativedelta(days=1)
if period_end_date == to_date:
break