From c54619570a37e774476fcc9123f28a0d76705289 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 14 Mar 2016 14:01:26 +0530 Subject: [PATCH] [fixes] check party_account_currency while creating Pull Request from Sales Invoice --- erpnext/accounts/doctype/payment_request/payment_request.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index 0c4619198e..f2679bab50 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -211,7 +211,10 @@ def get_amount(ref_doc, dt): grand_total = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid) if dt == "Sales Invoice": - grand_total = flt(ref_doc.grand_total) + if ref_doc.party_account_currency == ref_doc.currency: + grand_total = flt(ref_doc.outstanding_amount) + else: + grand_total = flt(ref_doc.outstanding_amount) / ref_doc.conversion_rate if grand_total > 0 : return grand_total