Skip to content

Commit

Permalink
Merge pull request #26 from sihaysistema/develop
Browse files Browse the repository at this point in the history
performance review
  • Loading branch information
monroy95 authored Jan 19, 2022
2 parents a88f807 + d7efb9b commit b759622
Show file tree
Hide file tree
Showing 6 changed files with 1,269 additions and 1,235 deletions.
19 changes: 19 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"arrowParens": "always",
"bracketSameLine": true,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 125,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"actions": [],
"creation": "2019-07-28 23:02:57.492873",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"moneda",
"codigo",
"convert"
"codigo"
],
"fields": [
{
Expand All @@ -22,17 +22,11 @@
"fieldtype": "Data",
"label": "Codigo",
"read_only": 1
},
{
"default": "0",
"fieldname": "convert",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Convert"
}
],
"istable": 1,
"modified": "2020-01-29 12:11:47.703255",
"links": [],
"modified": "2022-01-18 18:25:13.166364",
"modified_by": "Administrator",
"module": "Cambiare GTQ",
"name": "Available Currencies",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,68 +1,72 @@
// Copyright (c) 2019, Si Hay Sistema and contributors
// For license information, please see license.txt

frappe.ui.form.on('Configuration Cambiare', {
refresh: function (frm) {
// console.log('Se refresco form');
consulta_tipo_cambio_dia(frm)
// Obtiene las monedas disponibles de la API banguat
// frappe.call({
// method: "cambiare_gtq.api_cambiare.preparar_peticion_banguat",
// args: {
// opt: '6'
// },
// freeze: true,
// freeze_message: __("Obteniendo y guardando monedas disponibles del Banco de Guatemala..."),
// callback: function (r) {
// if (!r.exc) {
// clearInterval(frm.page["interval"]);
// // console.log(r.message)
// frappe.meta.get_docfield('Available Currencies', 'moneda', cur_frm.doc.name).options = r.message
// cur_frm.refresh_field('moneda');
// }
// }
// });
}
frappe.ui.form.on("Configuration Cambiare", {
refresh: function (frm) {
// console.log('Se refresco form');
consulta_tipo_cambio_dia(frm);
// Obtiene las monedas disponibles de la API banguat
// frappe.call({
// method: "cambiare_gtq.api_cambiare.preparar_peticion_banguat",
// args: {
// opt: '6'
// },
// freeze: true,
// freeze_message: __("Obteniendo y guardando monedas disponibles del Banco de Guatemala..."),
// callback: function (r) {
// if (!r.exc) {
// clearInterval(frm.page["interval"]);
// // console.log(r.message)
// frappe.meta.get_docfield('Available Currencies', 'moneda', cur_frm.doc.name).options = r.message
// cur_frm.refresh_field('moneda');
// }
// }
// });
frm.set_intro(
__("The default exchange rate is USD to GTQ and GTQ to USD. So there is no need to configure it in this section.")
);
},
});

let consulta_tipo_cambio_dia = function (frm) {
// Agrega un boton para consumir el webservice manualmente
frm.page.set_secondary_action(__("Tipo Cambio Manual"), function () {
frappe.call({
method: "cambiare_gtq.api_cambiare.preparar_peticion_banguat",
args: {
opt: '6'
},
freeze: true,
freeze_message: __("Consultado tipo cambio del dia de las monedas seleccionadas..."),
callback: function (r) {
if (!r.exc) {
clearInterval(frm.page["interval"]);
// frm.page.set_indicator(__('Importacion Exitosa!!'), 'blue');
// create_reset_button(frm);
console.log(r.message)
}
}
});
frappe.call({
method: "cambiare_gtq.api_cambiare.preparar_peticion_banguat",
args: {
opt: '1'
},
freeze: true,
freeze_message: __("Consultado tipo cambio del dia Dolares..."),
callback: function (r) {
if (!r.exc) {
clearInterval(frm.page["interval"]);
// frm.page.set_indicator(__('Importacion Exitosa!!'), 'blue');
// create_reset_button(frm);
console.log(r.message)
}
}
});
}).addClass('btn btn-primary');
}

// Agrega un boton para consumir el webservice manualmente
frm.page
.set_secondary_action(__("Tipo Cambio Manual"), function () {
frappe.call({
method: "cambiare_gtq.api_cambiare.preparar_peticion_banguat",
args: {
opt: "6",
},
freeze: true,
freeze_message: __("Consultado tipo cambio del dia de las monedas seleccionadas..."),
callback: function (r) {
if (!r.exc) {
clearInterval(frm.page["interval"]);
// frm.page.set_indicator(__('Importacion Exitosa!!'), 'blue');
// create_reset_button(frm);
console.log(r.message);
}
},
});
frappe.call({
method: "cambiare_gtq.api_cambiare.preparar_peticion_banguat",
args: {
opt: "1",
},
freeze: true,
freeze_message: __("Consultado tipo cambio del dia Dolares..."),
callback: function (r) {
if (!r.exc) {
clearInterval(frm.page["interval"]);
// frm.page.set_indicator(__('Importacion Exitosa!!'), 'blue');
// create_reset_button(frm);
console.log(r.message);
}
},
});
})
.addClass("btn btn-primary");
};

// Tabla hija
// frappe.ui.form.on('Available Currencies', {
Expand All @@ -75,4 +79,4 @@ let consulta_tipo_cambio_dia = function (frm) {
// form_render: function (frm) {
// console.log('Se renderizo');
// }
// });
// });
5 changes: 3 additions & 2 deletions cambiare_gtq/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# Si Hay Sistema and Contributors 2020
# Si Hay Sistema and Contributors 2022

from __future__ import unicode_literals
from . import __version__ as app_version

Expand Down Expand Up @@ -35,7 +36,7 @@ def fill_fixtures():
"Configuration Cambiare", "Transaction Start Date", "Transaction End Date",
"Currency Exchange GTQ", "Of Source Bank Account", "Third Party",
"Cambiare Cheque Print Set", "Remark ID", "Bank Account Currency",
"Batch Check Print",
"Batch Check Print", "The default exchange rate is USD to GTQ and GTQ to USD. So there is no need to configure it in this section."
]
]
]
Expand Down
Loading

0 comments on commit b759622

Please sign in to comment.