From 1e886a44d81b45f60a2c68793dc9c51f722f997d Mon Sep 17 00:00:00 2001 From: Luis Rendon Date: Tue, 24 Oct 2023 18:57:51 -0500 Subject: [PATCH] se corrigio el codigo y se elimino una peticion inecesaria --- .../Estatus/RtpAmazonInvoiceStatus.tsx | 30 +++---------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/src/Components/Clientes/Amazon/Reportes/Estatus/RtpAmazonInvoiceStatus.tsx b/src/Components/Clientes/Amazon/Reportes/Estatus/RtpAmazonInvoiceStatus.tsx index 72197eb..3c97e4c 100644 --- a/src/Components/Clientes/Amazon/Reportes/Estatus/RtpAmazonInvoiceStatus.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Estatus/RtpAmazonInvoiceStatus.tsx @@ -61,42 +61,20 @@ export default function RptAmazonInvoiceStatus( return yyyy + '-' + mm + '-' + dd } - // const loadReport = () => { - // // if (Factura.length == 0) { - // // setHeader('Error') - // // setMsg('Para continuar, proporcione la factura a buscar') - // // setShowMsg(true) - // // return - // // } - // DSAmazon.AmazonInvoiceStatusGET(Factura, Inicio, Fin) - // .then((response) => { - // setData(response.data) - // }) - // .catch((e: Error) => { - // alert('Ocurrio un error' + e.message.toString()) - // }) - // } - const loadReport = () => { - // Inicializa Inicio y Fin como cadenas vacías por defecto. - let InicioValue = '' - let FinValue = '' + let InicioValue + let FinValue // Verifica si se proporcionaron valores para Inicio y Fin. if (Factura) { - // Si se proporciona la factura, Inicio y Fin se establecen como vacíos. InicioValue = '' FinValue = '' - - // Limpia el campo de factura. setFactura('') } else { - // Si no se proporciona la factura, se mantienen los valores actuales de Inicio y Fin. InicioValue = Inicio FinValue = Fin } - // Realiza la solicitud con los valores actualizados de Inicio y Fin. DSAmazon.AmazonInvoiceStatusGET(Factura, InicioValue, FinValue) .then((response) => { setData(response.data) @@ -144,7 +122,7 @@ export default function RptAmazonInvoiceStatus( link.setAttribute('download', Referencia + '_FACTURAS_MODIFICA.xls') document.body.appendChild(link) link.click() - loadReport() + // loadReport() } }) .catch((e: Error) => { @@ -166,7 +144,7 @@ export default function RptAmazonInvoiceStatus( link.setAttribute('download', Referencia + '_PARTIDAS_MODIFICA.xls') document.body.appendChild(link) link.click() - loadReport() + // loadReport() } }) .catch((e: Error) => {