mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-12 17:51:20 +00:00
move function to util.py
This commit is contained in:
@@ -343,8 +343,8 @@ def set_gl_entries_by_account(
|
|||||||
},
|
},
|
||||||
as_dict=True)
|
as_dict=True)
|
||||||
|
|
||||||
if filters and filters.get('presentation_currency'):
|
# if filters and filters.get('presentation_currency'):
|
||||||
gl = convert_to_presentation_currency(gl_entries, get_currency(filters))
|
# gl_entries = convert_to_presentation_currency(gl_entries, get_currency(filters))
|
||||||
|
|
||||||
for entry in gl_entries:
|
for entry in gl_entries:
|
||||||
gl_entries_by_account.setdefault(entry.account, []).append(entry)
|
gl_entries_by_account.setdefault(entry.account, []).append(entry)
|
||||||
|
|||||||
@@ -10,15 +10,6 @@ from frappe import _, _dict
|
|||||||
from erpnext.accounts.utils import get_account_currency
|
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):
|
def execute(filters=None):
|
||||||
account_details = {}
|
account_details = {}
|
||||||
for acc in frappe.db.sql("""select name, is_group from tabAccount""", as_dict=1):
|
for acc in frappe.db.sql("""select name, is_group from tabAccount""", as_dict=1):
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import frappe
|
import frappe
|
||||||
from erpnext import get_company_currency
|
from erpnext import get_company_currency, get_default_company
|
||||||
from erpnext.accounts.report.general_ledger.general_ledger import get_appropriate_company
|
|
||||||
from erpnext.setup.utils import get_exchange_rate
|
from erpnext.setup.utils import get_exchange_rate
|
||||||
from frappe.utils import cint
|
from frappe.utils import cint
|
||||||
|
|
||||||
@@ -121,4 +120,13 @@ def convert_to_presentation_currency(gl_entries, currency_info):
|
|||||||
|
|
||||||
converted_gl_list.append(entry)
|
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
|
||||||
Reference in New Issue
Block a user