mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-18 06:22:12 +00:00
fix(payment request): get advance amount based on transaction currency
(cherry picked from commit b570d97b4d)
This commit is contained in:
@@ -670,7 +670,12 @@ def get_amount(ref_doc, payment_account=None):
|
|||||||
|
|
||||||
dt = ref_doc.doctype
|
dt = ref_doc.doctype
|
||||||
if dt in ["Sales Order", "Purchase Order"]:
|
if dt in ["Sales Order", "Purchase Order"]:
|
||||||
grand_total = (flt(ref_doc.rounded_total) or flt(ref_doc.grand_total)) - ref_doc.advance_paid
|
advance_amount = flt(ref_doc.advance_paid)
|
||||||
|
if ref_doc.party_account_currency != ref_doc.currency:
|
||||||
|
advance_amount = flt(flt(ref_doc.advance_paid) / ref_doc.conversion_rate)
|
||||||
|
|
||||||
|
grand_total = (flt(ref_doc.rounded_total) or flt(ref_doc.grand_total)) - advance_amount
|
||||||
|
|
||||||
elif dt in ["Sales Invoice", "Purchase Invoice"]:
|
elif dt in ["Sales Invoice", "Purchase Invoice"]:
|
||||||
if (
|
if (
|
||||||
dt == "Sales Invoice"
|
dt == "Sales Invoice"
|
||||||
|
|||||||
Reference in New Issue
Block a user