From c80ee824f86fd0e48808f42901e1c5a20bd897d8 Mon Sep 17 00:00:00 2001 From: DanielRamirezGe Date: Sun, 18 Oct 2020 21:59:56 -0500 Subject: [PATCH] actualziacion de cambio rechazo de pago --- routes/rechazarPago.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routes/rechazarPago.js b/routes/rechazarPago.js index 8b0d714..c448844 100644 --- a/routes/rechazarPago.js +++ b/routes/rechazarPago.js @@ -73,10 +73,14 @@ app.post('/rechazarPago', async(req, res) => { sqlQuery = `select * from persona where idPersona = ${data.idPersona};`; let datos = await query(sqlQuery); + datos = datos[0]; + sqlQuery = `delete from comprobante where idPersona = ${data.idPersona};`; + await query(sqlQuery); + if(datos.requiereFactura === true){ - sqlQuery = `delet * from factura where idPersona = ${data.idPersona};`; + sqlQuery = `delete from factura where idPersona = ${data.idPersona};`; await query(sqlQuery); sqlQuery = `update persona set requiereFactura = false where idPersona = ${data.idPersona};`;