fix: Add totals row when Grouped By Invoice
This commit is contained in:
parent
3aaf7cb408
commit
582a7ae964
@ -245,6 +245,7 @@ class GrossProfitGenerator(object):
|
||||
self.add_to_totals(new_row)
|
||||
else:
|
||||
for i, row in enumerate(self.grouped[key]):
|
||||
if row.indent == 1.0:
|
||||
if row.parent in self.returned_invoices \
|
||||
and row.item_code in self.returned_invoices[row.parent]:
|
||||
returned_item_rows = self.returned_invoices[row.parent][row.item_code]
|
||||
@ -256,7 +257,15 @@ class GrossProfitGenerator(object):
|
||||
row = self.set_average_rate(row)
|
||||
self.grouped_data.append(row)
|
||||
self.add_to_totals(row)
|
||||
|
||||
self.set_average_gross_profit(self.totals)
|
||||
|
||||
if self.filters.get("group_by") == "Invoice":
|
||||
self.totals.indent = 0.0
|
||||
self.totals.parent_invoice = ""
|
||||
self.totals.parent = "Totals"
|
||||
self.si_list.append(self.totals)
|
||||
else:
|
||||
self.grouped_data.append(self.totals)
|
||||
|
||||
def is_not_invoice_row(self, row):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user