fix: Incorrect exchange rate in payment entries (#33481)
* fix: Incorrect exchange rate in payment entries * test: Update failing tests
This commit is contained in:
parent
58ad79d3e8
commit
0ed938a490
@ -247,7 +247,7 @@ class PaymentEntry(AccountsController):
|
||||
self.set_target_exchange_rate(ref_doc)
|
||||
|
||||
def set_source_exchange_rate(self, ref_doc=None):
|
||||
if self.paid_from and not self.source_exchange_rate:
|
||||
if self.paid_from:
|
||||
if self.paid_from_account_currency == self.company_currency:
|
||||
self.source_exchange_rate = 1
|
||||
else:
|
||||
|
@ -743,9 +743,9 @@ class TestPurchaseOrder(FrappeTestCase):
|
||||
pe = get_payment_entry("Purchase Order", po_doc.name)
|
||||
pe.mode_of_payment = "Cash"
|
||||
pe.paid_from = "Cash - _TC"
|
||||
pe.source_exchange_rate = 80
|
||||
pe.target_exchange_rate = 1
|
||||
pe.paid_amount = po_doc.grand_total
|
||||
pe.source_exchange_rate = 1
|
||||
pe.target_exchange_rate = 80
|
||||
pe.paid_amount = po_doc.base_grand_total
|
||||
pe.save(ignore_permissions=True)
|
||||
pe.submit()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user