fix: Incorrect exchange rate in payment entries (#33481)
fix: Incorrect exchange rate in payment entries (#33481)
* fix: Incorrect exchange rate in payment entries
* test: Update failing tests
(cherry picked from commit 0ed938a490)
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
This commit is contained in:
@@ -247,7 +247,7 @@ class PaymentEntry(AccountsController):
|
|||||||
self.set_target_exchange_rate(ref_doc)
|
self.set_target_exchange_rate(ref_doc)
|
||||||
|
|
||||||
def set_source_exchange_rate(self, ref_doc=None):
|
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:
|
if self.paid_from_account_currency == self.company_currency:
|
||||||
self.source_exchange_rate = 1
|
self.source_exchange_rate = 1
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -743,9 +743,9 @@ class TestPurchaseOrder(FrappeTestCase):
|
|||||||
pe = get_payment_entry("Purchase Order", po_doc.name)
|
pe = get_payment_entry("Purchase Order", po_doc.name)
|
||||||
pe.mode_of_payment = "Cash"
|
pe.mode_of_payment = "Cash"
|
||||||
pe.paid_from = "Cash - _TC"
|
pe.paid_from = "Cash - _TC"
|
||||||
pe.source_exchange_rate = 80
|
pe.source_exchange_rate = 1
|
||||||
pe.target_exchange_rate = 1
|
pe.target_exchange_rate = 80
|
||||||
pe.paid_amount = po_doc.grand_total
|
pe.paid_amount = po_doc.base_grand_total
|
||||||
pe.save(ignore_permissions=True)
|
pe.save(ignore_permissions=True)
|
||||||
pe.submit()
|
pe.submit()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user