Merge pull request #18611 from surajshetty3416/fix-paid-amount

fix: Paid amount 0 while creating advanced payment entry
This commit is contained in:
Suraj Shetty 2019-09-02 08:38:34 +05:30 committed by GitHub
commit 4a8710ef75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -947,10 +947,15 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
paid_amount = abs(outstanding_amount)
if bank_amount:
received_amount = bank_amount
else:
received_amount = paid_amount * doc.conversion_rate
else:
received_amount = abs(outstanding_amount)
if bank_amount:
paid_amount = bank_amount
else:
# if party account currency and bank currency is different then populate paid amount as well
paid_amount = received_amount * doc.conversion_rate
pe = frappe.new_doc("Payment Entry")
pe.payment_type = payment_type