move function to util.py

This commit is contained in:
tundebabzy
2018-01-23 16:21:09 +01:00
parent d0c552d63b
commit 2bc81f45ed
3 changed files with 13 additions and 14 deletions

View File

@@ -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)

View File

@@ -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):

View File

@@ -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
return converted_gl_list
def get_appropriate_company(filters):
if filters.get('company'):
company = filters['company']
else:
company = get_default_company()
return company