From 2bc81f45ed9fa5eb69fe4859cc3153e2a9880ff1 Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Tue, 23 Jan 2018 16:21:09 +0100 Subject: [PATCH] move function to util.py --- erpnext/accounts/report/financial_statements.py | 4 ++-- .../report/general_ledger/general_ledger.py | 9 --------- erpnext/accounts/report/utils.py | 14 +++++++++++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 043f700a886..f038188dc23 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -343,8 +343,8 @@ def set_gl_entries_by_account( }, as_dict=True) - if filters and filters.get('presentation_currency'): - gl = convert_to_presentation_currency(gl_entries, get_currency(filters)) + # if filters and filters.get('presentation_currency'): + # gl_entries = convert_to_presentation_currency(gl_entries, get_currency(filters)) for entry in gl_entries: gl_entries_by_account.setdefault(entry.account, []).append(entry) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 532ed244dbc..e5000e3a4d4 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -10,15 +10,6 @@ from frappe import _, _dict from erpnext.accounts.utils import get_account_currency -def get_appropriate_company(filters): - if filters.get('company'): - company = filters['company'] - else: - company = get_default_company() - - return company - - def execute(filters=None): account_details = {} for acc in frappe.db.sql("""select name, is_group from tabAccount""", as_dict=1): diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index 610bb13a68e..79d49a72ef1 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -1,6 +1,5 @@ import frappe -from erpnext import get_company_currency -from erpnext.accounts.report.general_ledger.general_ledger import get_appropriate_company +from erpnext import get_company_currency, get_default_company from erpnext.setup.utils import get_exchange_rate from frappe.utils import cint @@ -121,4 +120,13 @@ def convert_to_presentation_currency(gl_entries, currency_info): converted_gl_list.append(entry) - return converted_gl_list \ No newline at end of file + return converted_gl_list + + +def get_appropriate_company(filters): + if filters.get('company'): + company = filters['company'] + else: + company = get_default_company() + + return company \ No newline at end of file