Commit 4e71b6b4 authored by Alberto Inch's avatar Alberto Inch

Validación masiva

parent b75b9674
......@@ -329,13 +329,17 @@ module.exports = (app) => {
if (validacion.codigoEstado === 908) {
await app.dao.venta.setValidadoPaquete([], validacion.codigoRecepcion, t);
} else {
if (validacion.codigoEstado === 904) {
const idsObs = await app.dao.venta.registrarObs(validacion.listaErroresDetalles, 'OBSERVADO', t);
if (idsVal.length > 0) {
await await app.dao.venta.setValidadoPaquete(idsObs, validacion.codigoRecepcion, t);
if (validacion.listaErroresDetalles) {
if (validacion.codigoEstado === 904) {
const idsObs = await app.dao.venta.registrarObs(validacion.listaErroresDetalles, 'OBSERVADO', t);
if (idsVal.length > 0) {
await await app.dao.venta.setValidadoPaquete(idsObs, validacion.codigoRecepcion, t);
}
} else {
await logs(models.logs).error(await app.dao.catalogo.getErrores(idPuntoVenta, validacion.listaErroresDetalles.map(val => val.toString())), 'INESPERADO', `factura.js 272`, 'system');
}
} else {
await logs(models.logs).error(await app.dao.catalogo.getErrores(idPuntoVenta, validacion.listaErroresDetalles.map(val => val.toString())), 'INESPERADO', `factura.js 272`, 'system');
throw Error(await app.dao.catalogo.getError(idPuntoVenta, validacion.listaCodigosRespuestas.map(c => c.toString())));
}
}
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment