calls erpnext.setup.utils.get_exchange_rate instead of get_average_exchange_rate

This commit is contained in:
tunde 2017-06-08 14:23:49 +01:00
parent 89f7dd3c98
commit 3eb5cb14d1

View File

@ -317,10 +317,12 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("source_exchange_rate", 1); frm.set_value("source_exchange_rate", 1);
} else if (frm.doc.paid_from){ } else if (frm.doc.paid_from){
if (in_list(["Internal Transfer", "Pay"], frm.doc.payment_type)) { if (in_list(["Internal Transfer", "Pay"], frm.doc.payment_type)) {
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
frappe.call({ frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_average_exchange_rate", method: "erpnext.setup.utils.get_exchange_rate",
args: { args: {
account: frm.doc.paid_from from_currency: frm.doc.paid_from_account_currency,
to_currency: company_currency
}, },
callback: function(r, rt) { callback: function(r, rt) {
frm.set_value("source_exchange_rate", r.message); frm.set_value("source_exchange_rate", r.message);