fix: Payment Request Amount calculation in case of multicurrency (#30254) (#30326)

(cherry picked from commit 9abd22b408)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
mergify[bot]
2022-03-21 14:57:25 +05:30
committed by GitHub
parent 230d171c58
commit 2148e7e32d

View File

@@ -394,7 +394,10 @@ def get_amount(ref_doc, payment_account=None):
"""get amount based on doctype"""
dt = ref_doc.doctype
if dt in ["Sales Order", "Purchase Order"]:
grand_total = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
if ref_doc.party_account_currency == ref_doc.currency:
grand_total = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
else:
grand_total = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid) / ref_doc.conversion_rate
elif dt in ["Sales Invoice", "Purchase Invoice"]:
if ref_doc.party_account_currency == ref_doc.currency: