From 4716523c7768cb62672c06a39ab041f89256f609 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Thu, 4 Nov 2021 05:38:00 +0000 Subject: [PATCH] fix: sider issues --- .../currency_exchange_settings.js | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js index 58a2b8c7a4..22cfc906fb 100644 --- a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js +++ b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js @@ -3,41 +3,41 @@ frappe.ui.form.on('Currency Exchange Settings', { service_provider: function(frm) { - if (frm.doc.service_provider == "Exchangerate.host"){ - let result = ['result'] - let params = { - date: '{transaction_date}', - from: '{from_currency}', - to: '{to_currency}' - } - add_param(frm, "https://api.exchangerate.host/convert", params, result) - } - else if (frm.doc.service_provider == "Frankfurter.app"){ - let result = ['rates', '{to_currency}'] - let params = { - base: '{from_currency}', - symbols: '{to_currency}' - } - add_param(frm, "https://frankfurter.app/{transaction_date}", params, result) - } + if (frm.doc.service_provider == "Exchangerate.host") { + let result = ['result']; + let params = { + date: '{transaction_date}', + from: '{from_currency}', + to: '{to_currency}' + }; + add_param(frm, "https://api.exchangerate.host/convert", params, result); + } + else if (frm.doc.service_provider == "Frankfurter.app") { + let result = ['rates', '{to_currency}']; + let params = { + base: '{from_currency}', + symbols: '{to_currency}' + }; + add_param(frm, "https://frankfurter.app/{transaction_date}", params, result); + } } }); -function add_param(frm, api, params, result){ +function add_param(frm, api, params, result) { var row; - frm.clear_table("req_params") - frm.clear_table("result_key") + frm.clear_table("req_params"); + frm.clear_table("result_key"); frm.doc.api_endpoint = api; - $.each(params, function(key, value){ + $.each(params, function(key, value) { row = frm.add_child("req_params"); row.key = key; row.value = value; }); - $.each(result, function(key, value){ + $.each(result, function(key, value) { row = frm.add_child("result_key"); row.key = value; });