diff --git a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py index a7b7f270cfd9..f0ca405401d3 100644 --- a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py +++ b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py @@ -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