Skip to content

Commit

Permalink
Merge branch 'develop' into fixed-time-out-error-reposting
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure authored Jul 5, 2022
2 parents 16f021a + 8835d16 commit 4ee7222
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ def create_sales_invoice(
)
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
"""
payment = create_payment_entry(
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,
Expand Down Expand Up @@ -529,10 +529,13 @@ def test_pr_output_foreign_currency_and_amount(self):

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()
Expand Down

0 comments on commit 4ee7222

Please sign in to comment.