Skiping total row for tree-view reports
This commit is contained in:
parent
9819b96141
commit
fbd66574ad
@ -23,7 +23,14 @@ class Analytics(object):
|
|||||||
self.get_columns()
|
self.get_columns()
|
||||||
self.get_data()
|
self.get_data()
|
||||||
self.get_chart_data()
|
self.get_chart_data()
|
||||||
return self.columns, self.data, None, self.chart
|
|
||||||
|
# Skiping total row for tree-view reports
|
||||||
|
skip_total_row = 0
|
||||||
|
|
||||||
|
if self.filters.tree_type in ["Supplier Group", "Item Group", "Customer Group", "Territory"]:
|
||||||
|
skip_total_row = 1
|
||||||
|
|
||||||
|
return self.columns, self.data, None, self.chart, None, skip_total_row
|
||||||
|
|
||||||
def get_columns(self):
|
def get_columns(self):
|
||||||
self.columns = [{
|
self.columns = [{
|
||||||
@ -194,9 +201,6 @@ class Analytics(object):
|
|||||||
def get_rows(self):
|
def get_rows(self):
|
||||||
self.data = []
|
self.data = []
|
||||||
self.get_periodic_data()
|
self.get_periodic_data()
|
||||||
total_row = {
|
|
||||||
"entity": "Total",
|
|
||||||
}
|
|
||||||
|
|
||||||
for entity, period_data in iteritems(self.entity_periodic_data):
|
for entity, period_data in iteritems(self.entity_periodic_data):
|
||||||
row = {
|
row = {
|
||||||
@ -210,9 +214,6 @@ class Analytics(object):
|
|||||||
row[scrub(period)] = amount
|
row[scrub(period)] = amount
|
||||||
total += amount
|
total += amount
|
||||||
|
|
||||||
if not total_row.get(scrub(period)): total_row[scrub(period)] = 0
|
|
||||||
total_row[scrub(period)] += amount
|
|
||||||
|
|
||||||
row["total"] = total
|
row["total"] = total
|
||||||
|
|
||||||
if self.filters.tree_type == "Item":
|
if self.filters.tree_type == "Item":
|
||||||
@ -220,8 +221,6 @@ class Analytics(object):
|
|||||||
|
|
||||||
self.data.append(row)
|
self.data.append(row)
|
||||||
|
|
||||||
self.data.append(total_row)
|
|
||||||
|
|
||||||
def get_rows_by_group(self):
|
def get_rows_by_group(self):
|
||||||
self.get_periodic_data()
|
self.get_periodic_data()
|
||||||
out = []
|
out = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user