From dc5fd960ebea7ec72e227ff232ec8a3ae352683f Mon Sep 17 00:00:00 2001 From: Victor Sanchez Sosa <41167132+Marcelo3Sanchez@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:58:31 -0500 Subject: [PATCH] Update metodos.js --- metodos.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/metodos.js b/metodos.js index d188599..87ef220 100644 --- a/metodos.js +++ b/metodos.js @@ -649,10 +649,37 @@ async function Fun_ConsultarClavesCatastrales(agent, req, res, _cedula = null, n let legion = await funcion.ConsultaClaves(_cedula, nuevo); if (legion['ok'] == true) { let printzeus = ''; + legion['data']['data'].forEach((elem_ares, index) => { printzeus += '\n*' + elem_ares.name + (elem_ares.value != null ? ': $' + elem_ares.value : ''); - }); + }); + + $t_int = 0; + $t_pag = 0; + $d_tt = 0; + if (legion['data']['data_add'].length > 0) { + printzeus += '\n\n Ud cuenta con rubros que aplican a la remisión intereses:'; + legion['data']['data_add'].forEach((elem_ares, index) => { + $d_tt += elem_ares.deuda_total; + $t_int += elem_ares.ahorro; + $t_pag += elem_ares.total_remision; + printzeus +='\n*'+elem_ares.rubro + ' - Desde: '+elem_ares.anio_min + ' Hasta: '+elem_ares.anio_max; + printzeus +='\nDeuda a la fecha: '+elem_ares.deuda_total; + printzeus +='\nCapital: '+elem_ares.deuda_total; + printzeus +='\nInterés exonerado por remisión: '+elem_ares.ahorro; + printzeus +='\nValor a pagar: '+elem_ares.total_remision + '\n\n'; + }); + + printzeus += '\n\n Deuda total: '+$t_pag; + printzeus += '\n Total de interés exonerado por remisión: '+$t_int; + printzeus += '\n Valor a pagar: '+$d_tt; + } + + agent.add(printzeus); + + + return Fun_RetornarAlinicio(agent, req, res, funcion.conver_name(data_context.name)); } else { agent.add(funcion.conver_name(data_context.name) + ', ' + legion['msg']);