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

This commit is contained in:
Nabin Hait
2022-03-21 14:20:15 +05:30
committed by GitHub
parent 71d6209a29
commit 9abd22b408

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: