From 9646be1d5d80a81ac718da862060bb1e3a4c5058 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 30 Dec 2016 11:14:11 +0530 Subject: [PATCH] [fix] Make Journal Entry against SO --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index cd79363502..1dd1ee9678 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -651,7 +651,8 @@ def get_payment_entry(ref_doc, args): if args.get("party_account"): # Modified to include the posting date for which the exchange rate is required. # Assumed to be the posting date in the reference document - exchange_rate = get_exchange_rate(ref_doc.posting_date, args.get("party_account"), args.get("party_account_currency"), + exchange_rate = get_exchange_rate(ref_doc.get("posting_date") or ref_doc.get("transaction_date"), + args.get("party_account"), args.get("party_account_currency"), ref_doc.company, ref_doc.doctype, ref_doc.name) je = frappe.new_doc("Journal Entry") @@ -686,7 +687,8 @@ def get_payment_entry(ref_doc, args): bank_row.update(bank_account) # Modified to include the posting date for which the exchange rate is required. # Assumed to be the posting date of the reference date - bank_row.exchange_rate = get_exchange_rate(ref_doc.posting_date, bank_account["account"], + bank_row.exchange_rate = get_exchange_rate(ref_doc.get("posting_date") + or ref_doc.get("transaction_date"), bank_account["account"], bank_account["account_currency"], ref_doc.company) bank_row.cost_center = cost_center