fix: incorrect total in sales analytics for customer/item group
This commit is contained in:
parent
dfa60e0ed8
commit
971170c590
@ -225,9 +225,6 @@ class Analytics(object):
|
|||||||
def get_rows_by_group(self):
|
def get_rows_by_group(self):
|
||||||
self.get_periodic_data()
|
self.get_periodic_data()
|
||||||
out = []
|
out = []
|
||||||
total_row = {
|
|
||||||
"entity": "Total",
|
|
||||||
}
|
|
||||||
|
|
||||||
for d in reversed(self.group_entries):
|
for d in reversed(self.group_entries):
|
||||||
row = {
|
row = {
|
||||||
@ -245,12 +242,10 @@ class Analytics(object):
|
|||||||
total += amount
|
total += amount
|
||||||
|
|
||||||
if not total_row.get(scrub(period)): total_row[scrub(period)] = 0
|
if not total_row.get(scrub(period)): total_row[scrub(period)] = 0
|
||||||
total_row[scrub(period)] += amount
|
|
||||||
|
|
||||||
row["total"] = total
|
row["total"] = total
|
||||||
out = [row] + out
|
out = [row] + out
|
||||||
|
|
||||||
out.append(total_row)
|
|
||||||
self.data = out
|
self.data = out
|
||||||
|
|
||||||
def get_periodic_data(self):
|
def get_periodic_data(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user