agregarRecibo

This commit is contained in:
Andres2908
2022-09-07 14:24:14 -05:00
parent 1e3f49a1ab
commit ce6dc0405d
3 changed files with 11 additions and 10 deletions
+2 -2
View File
@@ -50,10 +50,10 @@ const agregarRecibo = async (folio, monto, fechaTicket, numeroCuenta) => {
const conn = await pool.getConnection().catch((err) => {
throw new Error('No se pudo conectar con la db. ' + err);
});
console.log(fechaTicket)
return conn
.query(
`INSERT INTO recibo(folio_recibo, monto, fecha_recibo, fecha_registro, id_cuenta, id_usuario) values(${folio}, ${monto}, STR_TO_DATE('${fechaTicket}', '%m/%d/%Y'), now() ,${numeroCuenta}, 134)`
`INSERT INTO recibo(folio_recibo, monto, fecha_recibo, fecha_registro, id_cuenta, id_usuario) values(${folio}, ${monto}, '${fechaTicket}', now() ,${numeroCuenta}, 134)`
)
.then((rows) => {
conn.end();
@@ -67,10 +67,11 @@ const inscripcion = async (body, file) => {
.then((res) => {
if (file && folio && monto && fechaTicket) {
fs.renameSync(file.path, file.path + '.' + file.mimetype.split('/')[1]);
agregarRecibo(
folio,
monto,
moment(fechaTicket).format('L'),
moment(new Date(fechaTicket)).format('YYYY-MM-DD'),
numeroCuenta
);
agregarDetalleServicio(monto, numeroCuenta);
+7 -7
View File
@@ -8,13 +8,13 @@ const login = async (body) => {
body.numeroCuenta,
'número de cuenta',
true
);
const data = {
usuario: 'votacionesUser',
password: 'poasfnr*/049_]',
numeroCuenta: numeroCuenta,
passwordUser: body.passwordUser,
};
);
const data = {
usuario: 'votacionesUser',
password: 'poasfnr*/049_]',
numeroCuenta: numeroCuenta,
passwordUser: body.passwordUser,
};
return axios
.post(