From 3d1434afe7f072ceccd5c3a9702012476ad981d4 Mon Sep 17 00:00:00 2001 From: Ricardo Johann Date: Tue, 28 Mar 2017 01:49:11 -0300 Subject: [PATCH] Export total labels --- erpnext/accounts/report/balance_sheet/balance_sheet.py | 6 +++--- erpnext/accounts/report/financial_statements.py | 2 +- .../profitability_analysis/profitability_analysis.py | 6 +++++- erpnext/accounts/report/trial_balance/trial_balance.py | 9 ++++++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py index 7e57dce67a7..4325afcd291 100644 --- a/erpnext/accounts/report/balance_sheet/balance_sheet.py +++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py @@ -26,7 +26,7 @@ def execute(filters=None): if opening_balance and round(opening_balance,2) !=0: unclosed ={ "account_name": "'" + _("Unclosed Fiscal Years Profit / Loss (Credit)") + "'", - "account": None, + "account": "'" + _("Unclosed Fiscal Years Profit / Loss (Credit)") + "'", "warn_if_negative": True, "currency": frappe.db.get_value("Company", filters.company, "default_currency") } @@ -57,7 +57,7 @@ def get_provisional_profit_loss(asset, liability, equity, period_list, company): currency = frappe.db.get_value("Company", company, "default_currency") total_row = { "account_name": "'" + _("Total (Credit)") + "'", - "account": None, + "account": "'" + _("Total (Credit)") + "'", "warn_if_negative": True, "currency": currency } @@ -85,7 +85,7 @@ def get_provisional_profit_loss(asset, liability, equity, period_list, company): if has_value: provisional_profit_loss.update({ "account_name": "'" + _("Provisional Profit / Loss (Credit)") + "'", - "account": None, + "account": "'" + _("Provisional Profit / Loss (Credit)") + "'", "warn_if_negative": True, "currency": currency }) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index fb1c4ac8130..80b0bf25587 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -216,7 +216,7 @@ def filter_out_zero_value_rows(data, parent_children_map, show_zero_values=False def add_total_row(out, root_type, balance_must_be, period_list, company_currency): total_row = { "account_name": "'" + _("Total {0} ({1})").format(root_type, balance_must_be) + "'", - "account": None, + "account": "'" + _("Total {0} ({1})").format(root_type, balance_must_be) + "'", "currency": company_currency } diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py index c0a42127e88..8bc19540d09 100644 --- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py +++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py @@ -60,7 +60,11 @@ def calculate_values(accounts, gl_entries_by_account, filters): "warn_if_negative": True, "income": 0.0, "expense": 0.0, - "gross_profit_loss": 0.0 + "gross_profit_loss": 0.0, + "account": "'" + _("Total") + "'", + "parent_account": None, + "indent": 0, + "has_value": True } for d in accounts: diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 7609d1d95b5..5f606e4e98f 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -130,11 +130,14 @@ def calculate_values(accounts, gl_entries_by_account, opening_balances, filters) } total_row = { - "account": None, - "account_name": _("Total"), + "account": "'" + _("Total") + "'", + "account_name": "'" + _("Total") + "'", "warn_if_negative": True, "debit": 0.0, - "credit": 0.0 + "credit": 0.0, + "parent_account": None, + "indent": 0, + "has_value": True } for d in accounts: