mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
Merge pull request #46566 from ruthra-kumar/correct_account_currency_in_offset_account
fix: set correct currency for offset account gl entries
This commit is contained in:
@@ -82,6 +82,10 @@ def make_acc_dimensions_offsetting_entry(gl_map):
|
|||||||
"credit_in_account_currency": credit,
|
"credit_in_account_currency": credit,
|
||||||
"remarks": _("Offsetting for Accounting Dimension") + f" - {dimension.name}",
|
"remarks": _("Offsetting for Accounting Dimension") + f" - {dimension.name}",
|
||||||
"against_voucher": None,
|
"against_voucher": None,
|
||||||
|
"account_currency": dimension.account_currency,
|
||||||
|
# Party Type and Party are restricted to Receivable and Payable accounts
|
||||||
|
"party_type": None,
|
||||||
|
"party": None,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
offsetting_entry["against_voucher_type"] = None
|
offsetting_entry["against_voucher_type"] = None
|
||||||
@@ -109,6 +113,9 @@ def get_accounting_dimensions_for_offsetting_entry(gl_map, company):
|
|||||||
accounting_dimensions_to_offset = []
|
accounting_dimensions_to_offset = []
|
||||||
for acc_dimension in acc_dimensions:
|
for acc_dimension in acc_dimensions:
|
||||||
values = set([entry.get(acc_dimension.fieldname) for entry in gl_map])
|
values = set([entry.get(acc_dimension.fieldname) for entry in gl_map])
|
||||||
|
acc_dimension.account_currency = frappe.get_cached_value(
|
||||||
|
"Account", acc_dimension.offsetting_account, "account_currency"
|
||||||
|
)
|
||||||
if len(values) > 1:
|
if len(values) > 1:
|
||||||
accounting_dimensions_to_offset.append(acc_dimension)
|
accounting_dimensions_to_offset.append(acc_dimension)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user