From f3bdeedc686e25e7b43913fa271e7dc42bbd3b6c Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Mon, 4 Mar 2019 12:27:41 +0530 Subject: [PATCH] minor fixes --- .../gross_and_net_profit_report.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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 739c4f0051..a0432dbef3 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 @@ -79,10 +79,10 @@ def get_revenue(data, period_list, revenue_type): def remove_parent_with_no_child(data, period_list): status = "nothing to remove" for parent in data: - if 'is_group' in parent and parent["is_group"] == 1: + if 'is_group' in parent and parent.get("is_group") == 1: have_child = False for child in data: - if 'parent_account' in child and child["parent_account"] == parent["account"]: + if 'parent_account' in child and child.get("parent_account") == parent.get("account"): have_child = True break @@ -116,8 +116,6 @@ def set_total(node, value, complete_list, totals): def get_profit(gross_income, gross_expense, period_list, company, profit_type, currency=None, consolidated=False): - total = 0 - profit_loss = { "account_name": "'" + _(profit_type) + "'", "account": "'" + _(profit_type) + "'", @@ -134,14 +132,10 @@ def get_profit(gross_income, gross_expense, period_list, company, profit_type, c if profit_loss[key]: has_value=True - total += flt(profit_loss[key]) - profit_loss['total'] = total - if has_value: return profit_loss def get_net_profit(non_gross_income, gross_income, gross_expense, non_gross_expense, period_list, company, currency=None, consolidated=False): - total = 0 profit_loss = { "account_name": "'" + _("Net Profit") + "'", "account": "'" + _("Net Profit") + "'", @@ -160,8 +154,5 @@ def get_net_profit(non_gross_income, gross_income, gross_expense, non_gross_expe if profit_loss[key]: has_value=True - total += flt(profit_loss[key]) - profit_loss['total'] = total - if has_value: return profit_loss