From 104c45ecc4988e23809233a1057231a1784c5c46 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 4 Jul 2022 18:04:29 +0530 Subject: [PATCH] fix: test pr output for amount and currency --- .../test_payment_reconciliation.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py index 325346d6b6..625382a3e9 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py @@ -151,7 +151,7 @@ class TestPaymentReconciliation(FrappeTestCase): ) return sinv - def create_payment_entry(self, amount=100, posting_date=nowdate()): + def create_payment_entry(self, amount=100, posting_date=nowdate(), customer=None): """ Helper function to populate default values in payment entry """ @@ -159,7 +159,7 @@ class TestPaymentReconciliation(FrappeTestCase): company=self.company, payment_type="Receive", party_type="Customer", - party=self.customer, + party=customer or self.customer, paid_from=self.debit_to, paid_to=self.bank, paid_amount=amount, @@ -529,10 +529,13 @@ class TestPaymentReconciliation(FrappeTestCase): cr_note.cancel() - from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry - - pay = get_payment_entry(si.doctype, si.name) - pay.references.clear() + pay = self.create_payment_entry( + amount=amount, posting_date=transaction_date, customer=self.customer3 + ) + pay.paid_from = self.debtors_eur + pay.paid_from_account_currency = "EUR" + pay.source_exchange_rate = exchange_rate + pay.received_amount = exchange_rate * amount pay = pay.save().submit() pr.get_unreconciled_entries()