From 9f9426689239338095b78a8d2b9ad9a5a4447b8a Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 14 Mar 2016 11:23:03 +0530 Subject: [PATCH 1/2] [fixes] fetch value from grand total field while creating payment request from si --- erpnext/accounts/doctype/payment_request/payment_request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index bd4cc4d622e..0c4619198e3 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -211,7 +211,7 @@ 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.outstanding_amount) + grand_total = flt(ref_doc.grand_total) if grand_total > 0 : return grand_total From c54619570a37e774476fcc9123f28a0d76705289 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 14 Mar 2016 14:01:26 +0530 Subject: [PATCH 2/2] [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 0c4619198e3..f2679bab503 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