From 6d3305c4461053a6d978beef379ca0f090fc10fa Mon Sep 17 00:00:00 2001 From: Afshan Date: Wed, 21 Apr 2021 15:34:58 +0530 Subject: [PATCH] fix: added total column --- .../dimension_wise_accounts_balance_report.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py index 7f38770a32..de7ed4926e 100644 --- a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py +++ b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py @@ -120,6 +120,7 @@ def prepare_data(accounts, filters, parent_children_map, company_currency, dimen for d in accounts: has_value = False + total = 0 row = { "account": d.name, "parent_account": d.parent_account, @@ -137,8 +138,10 @@ def prepare_data(accounts, filters, parent_children_map, company_currency, dimen if abs(row[frappe.scrub(item)]) >= 0.005: # ignore zero values has_value = True + total += flt(d.get(frappe.scrub(item), 0.0), 3) row["has_value"] = has_value + row["total"] = total data.append(row) return data @@ -199,5 +202,12 @@ def get_columns(dimension_items_list, accumulated_values=1, company=None): "options": "currency", "width": 150 }) + columns.append({ + "fieldname": "total", + "label": "Total", + "fieldtype": "Currency", + "options": "currency", + "width": 150 + }) return columns