Merge pull request #15991 from rohitwaghchaure/fixed_consolidated_conversion_issue
[Fix] Consolidated financial statement report currency conversion issue
This commit is contained in:
commit
02a7f8f0b2
@ -331,12 +331,17 @@ def set_gl_entries_by_account(from_date, to_date, root_lft, root_rgt, filters, g
|
|||||||
filters.get('company'), ["lft", "rgt"])
|
filters.get('company'), ["lft", "rgt"])
|
||||||
|
|
||||||
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters)
|
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters)
|
||||||
|
companies = frappe.db.sql_list(""" select name from `tabCompany`
|
||||||
|
where lft >= %(company_lft)s and rgt <= %(company_rgt)s""", {
|
||||||
|
"company_lft": company_lft,
|
||||||
|
"company_rgt": company_rgt,
|
||||||
|
})
|
||||||
|
|
||||||
|
for company in companies:
|
||||||
gl_entries = frappe.db.sql("""select gl.posting_date, gl.account, gl.debit, gl.credit, gl.is_opening, gl.company,
|
gl_entries = frappe.db.sql("""select gl.posting_date, gl.account, gl.debit, gl.credit, gl.is_opening, gl.company,
|
||||||
gl.fiscal_year, gl.debit_in_account_currency, gl.credit_in_account_currency, gl.account_currency,
|
gl.fiscal_year, gl.debit_in_account_currency, gl.credit_in_account_currency, gl.account_currency,
|
||||||
acc.account_name, acc.account_number
|
acc.account_name, acc.account_number
|
||||||
from `tabGL Entry` gl, `tabAccount` acc where acc.name = gl.account and gl.company in
|
from `tabGL Entry` gl, `tabAccount` acc where acc.name = gl.account and gl.company = %(company)s
|
||||||
(select name from `tabCompany` where lft >= %(company_lft)s and rgt <= %(company_rgt)s)
|
|
||||||
{additional_conditions} and gl.posting_date <= %(to_date)s and acc.lft >= %(lft)s and acc.rgt <= %(rgt)s
|
{additional_conditions} and gl.posting_date <= %(to_date)s and acc.lft >= %(lft)s and acc.rgt <= %(rgt)s
|
||||||
order by gl.account, gl.posting_date""".format(additional_conditions=additional_conditions),
|
order by gl.account, gl.posting_date""".format(additional_conditions=additional_conditions),
|
||||||
{
|
{
|
||||||
@ -344,12 +349,12 @@ def set_gl_entries_by_account(from_date, to_date, root_lft, root_rgt, filters, g
|
|||||||
"to_date": to_date,
|
"to_date": to_date,
|
||||||
"lft": root_lft,
|
"lft": root_lft,
|
||||||
"rgt": root_rgt,
|
"rgt": root_rgt,
|
||||||
"company_lft": company_lft,
|
"company": company
|
||||||
"company_rgt": company_rgt,
|
|
||||||
},
|
},
|
||||||
as_dict=True)
|
as_dict=True)
|
||||||
|
|
||||||
if filters and filters.get('presentation_currency'):
|
if filters and filters.get('presentation_currency'):
|
||||||
|
filters['company'] = company
|
||||||
convert_to_presentation_currency(gl_entries, get_currency(filters))
|
convert_to_presentation_currency(gl_entries, get_currency(filters))
|
||||||
|
|
||||||
for entry in gl_entries:
|
for entry in gl_entries:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user