From 6462ba4e0b109434feac9e3353a71535c92f9234 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 26 Aug 2016 12:39:54 +0530 Subject: [PATCH] minor changes --- erpnext/accounts/report/financial_statements.py | 4 ++-- .../profitability_analysis/profitability_analysis.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 01853a7246..09174281bf 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -325,8 +325,8 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters): additional_conditions.append("posting_date >= %(from_date)s") if filters: - for key in filters: - if filters.get(key) and key in ['cost_center', 'project']: + for key in ['cost_center', 'project']: + if filters.get(key): additional_conditions.append("%s = '%s'"%(key, filters.get(key))) return " and {}".format(" and ".join(additional_conditions)) if additional_conditions else "" diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py index 7277dc2461..4f9fd15f66 100644 --- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py +++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py @@ -8,7 +8,7 @@ from frappe.utils import flt, getdate, formatdate, cstr from erpnext.accounts.report.financial_statements import filter_accounts, filter_out_zero_value_rows from erpnext.accounts.report.trial_balance.trial_balance import validate_filters -value_fields = ("income", "expense", "total") +value_fields = ("income", "expense", "gross_profit_loss") def execute(filters=None): based_on = filters.based_on.replace(' ', '_').lower() @@ -49,7 +49,7 @@ def calculate_values(accounts, gl_entries_by_account, filters): init = { "income": 0.0, "expense": 0.0, - "total": 0.0 + "gross_profit_loss": 0.0 } total_row = { @@ -58,7 +58,7 @@ def calculate_values(accounts, gl_entries_by_account, filters): "warn_if_negative": True, "income": 0.0, "expense": 0.0, - "total": 0.0 + "gross_profit_loss": 0.0 } for d in accounts: @@ -73,12 +73,12 @@ def calculate_values(accounts, gl_entries_by_account, filters): if entry.type == 'Expense': d["expense"] += flt(entry.debit) - flt(entry.credit) - d["total"] = d.get("income") - d.get("expense") + d["gross_profit_loss"] = d.get("income") - d.get("expense") total_row["income"] += d["income"] total_row["expense"] += d["expense"] - total_row["total"] = total_row.get("income") - total_row.get("expense") + total_row["gross_profit_loss"] = total_row.get("income") - total_row.get("expense") return total_row @@ -142,7 +142,7 @@ def get_columns(filters): "width": 120 }, { - "fieldname": "total", + "fieldname": "gross_profit_loss", "label": _("Gross Profit / Loss"), "fieldtype": "Currency", "options": "currency",