Skip to content

Commit

Permalink
Merge pull request #38873 from frappe/mergify/bp/version-15-hotfix/pr…
Browse files Browse the repository at this point in the history
…-38838

fix: use party account currency when party account is specified (backport #38838)
  • Loading branch information
ruthra-kumar authored Dec 20, 2023
2 parents d75ac13 + 2d9a0a8 commit 4626ab5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def update_voucher_balance(self, ple):
if not row:
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
else:
amount = ple.amount
Expand Down Expand Up @@ -455,7 +455,7 @@ def set_party_details(self, row):
party_details = self.get_party_details(row.party) or {}
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
else:
row.currency = self.company_currency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def test_party_account_filter(self):
filters.update({"party_account": self.debtors_usd})
report = execute(filters)[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]
self.assertEqual(
expected_data, [row.invoiced, row.outstanding, row.party_account, row.account_currency]
Expand Down

0 comments on commit 4626ab5

Please sign in to comment.