Merge branch 'master' into staging-fixes
This commit is contained in:
commit
a0e533ede5
@ -5,7 +5,7 @@ import frappe
|
|||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
from frappe.utils import getdate
|
from frappe.utils import getdate
|
||||||
|
|
||||||
__version__ = '10.1.61'
|
__version__ = '10.1.62'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
@ -339,19 +339,20 @@ def set_gl_entries_by_account(
|
|||||||
|
|
||||||
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters)
|
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters)
|
||||||
|
|
||||||
|
accounts = frappe.db.sql_list("""select name from `tabAccount`
|
||||||
|
where lft >= %s and rgt <= %s""", (root_lft, root_rgt))
|
||||||
|
additional_conditions += " and account in ('{}')"\
|
||||||
|
.format("', '".join([frappe.db.escape(d) for d in accounts]))
|
||||||
|
|
||||||
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year, debit_in_account_currency, credit_in_account_currency, account_currency from `tabGL Entry`
|
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year, debit_in_account_currency, credit_in_account_currency, account_currency from `tabGL Entry`
|
||||||
where company=%(company)s
|
where company=%(company)s
|
||||||
{additional_conditions}
|
{additional_conditions}
|
||||||
and posting_date <= %(to_date)s
|
and posting_date <= %(to_date)s
|
||||||
and account in (select name from `tabAccount`
|
|
||||||
where lft >= %(lft)s and rgt <= %(rgt)s)
|
|
||||||
order by account, posting_date""".format(additional_conditions=additional_conditions),
|
order by account, posting_date""".format(additional_conditions=additional_conditions),
|
||||||
{
|
{
|
||||||
"company": company,
|
"company": company,
|
||||||
"from_date": from_date,
|
"from_date": from_date,
|
||||||
"to_date": to_date,
|
"to_date": to_date,
|
||||||
"lft": root_lft,
|
|
||||||
"rgt": root_rgt,
|
|
||||||
"cost_center": filters.cost_center,
|
"cost_center": filters.cost_center,
|
||||||
"project": filters.project
|
"project": filters.project
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user