fix: add total col for gross and net profit

(cherry picked from commit cb9b4fbb91)
This commit is contained in:
Anoop Kurungadam
2023-05-10 12:34:15 +05:30
committed by Mergify
parent a53832e16e
commit e899c30428

View File

@@ -196,6 +196,9 @@ def get_profit(
if profit_loss[key]:
has_value = True
if not profit_loss.get("total"):
profit_loss["total"] = 0
profit_loss["total"] += profit_loss[key]
if has_value:
return profit_loss
@@ -234,6 +237,9 @@ def get_net_profit(
if profit_loss[key]:
has_value = True
if not profit_loss.get("total"):
profit_loss["total"] = 0
profit_loss["total"] += profit_loss[key]
if has_value:
return profit_loss