fix: fixed the logic

This commit is contained in:
Afshan 2020-07-23 20:33:07 +05:30
parent 767ee1cdb8
commit 775fbe74c5

View File

@ -62,13 +62,13 @@ def get_range_age(filters, fifo_queue, to_date):
age = date_diff(to_date, item[1])
if age <= filters.range1:
range1 = item[0]
range1 += item[0]
elif age <= filters.range2:
range2 = item[0]
range2 += item[0]
elif age <= filters.range3:
range3 = item[0]
range3 += item[0]
else:
above_range3 = item[0]
above_range3 += item[0]
return range1, range2, range3, above_range3
@ -290,7 +290,7 @@ def setup_ageing_columns(filters, range_columns):
"{range1}-{range2}".format(range1=cint(filters["range1"])+ 1, range2=filters["range2"]),
"{range2}-{range3}".format(range2=cint(filters["range2"])+ 1, range3=filters["range3"]),
"{range3}-{above}".format(range3=cint(filters["range3"])+ 1, above=_("Above"))]):
add_column(range_columns, label="Age in ("+ label +")", fieldname='range' + str(i+1))
add_column(range_columns, label="Age ("+ label +")", fieldname='range' + str(i+1))
def add_column(range_columns, label, fieldname, fieldtype='Float', width=140):
range_columns.append(dict(