fix: consider rounded total amount while making payment request (#34110)

fix: consider rounded total amount while making payment request (#34110)

(cherry picked from commit 9c6466f15b)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
This commit is contained in:
mergify[bot]
2023-02-19 13:38:02 +05:30
committed by GitHub
parent 53ab4d92e8
commit 78795643cc

View File

@@ -495,7 +495,7 @@ 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)
grand_total = flt(ref_doc.rounded_total) - flt(ref_doc.advance_paid)
elif dt in ["Sales Invoice", "Purchase Invoice"]:
if ref_doc.party_account_currency == ref_doc.currency: