From cb9b4fbb91f4b73916416167932064ef5965eed1 Mon Sep 17 00:00:00 2001 From: Anoop Kurungadam Date: Wed, 10 May 2023 12:34:15 +0530 Subject: [PATCH] fix: add total col for gross and net profit --- .../gross_and_net_profit_report.py | 6 ++++++ 1 file changed, 6 insertions(+) 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