Merge pull request #38873 from frappe/mergify/bp/version-15-hotfix/pr-38838
fix: use party account currency when party account is specified (backport #38838)
This commit is contained in:
commit
4626ab5e19
@ -225,7 +225,7 @@ class ReceivablePayableReport(object):
|
|||||||
if not row:
|
if not row:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.filters.get("in_party_currency"):
|
if self.filters.get("in_party_currency") or self.filters.get("party_account"):
|
||||||
amount = ple.amount_in_account_currency
|
amount = ple.amount_in_account_currency
|
||||||
else:
|
else:
|
||||||
amount = ple.amount
|
amount = ple.amount
|
||||||
@ -455,7 +455,7 @@ class ReceivablePayableReport(object):
|
|||||||
party_details = self.get_party_details(row.party) or {}
|
party_details = self.get_party_details(row.party) or {}
|
||||||
row.update(party_details)
|
row.update(party_details)
|
||||||
|
|
||||||
if self.filters.get("in_party_currency"):
|
if self.filters.get("in_party_currency") or self.filters.get("party_account"):
|
||||||
row.currency = row.account_currency
|
row.currency = row.account_currency
|
||||||
else:
|
else:
|
||||||
row.currency = self.company_currency
|
row.currency = self.company_currency
|
||||||
|
|||||||
@ -579,7 +579,7 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
|
|||||||
filters.update({"party_account": self.debtors_usd})
|
filters.update({"party_account": self.debtors_usd})
|
||||||
report = execute(filters)[1]
|
report = execute(filters)[1]
|
||||||
self.assertEqual(len(report), 1)
|
self.assertEqual(len(report), 1)
|
||||||
expected_data = [8000.0, 8000.0, self.debtors_usd, si2.currency]
|
expected_data = [100.0, 100.0, self.debtors_usd, si2.currency]
|
||||||
row = report[0]
|
row = report[0]
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
expected_data, [row.invoiced, row.outstanding, row.party_account, row.account_currency]
|
expected_data, [row.invoiced, row.outstanding, row.party_account, row.account_currency]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user