diff --git a/server/controller/Prestamo/regresar.js b/server/controller/Prestamo/regresar.js index a0fe81d..bd13c85 100644 --- a/server/controller/Prestamo/regresar.js +++ b/server/controller/Prestamo/regresar.js @@ -32,7 +32,7 @@ const regresar = async (body) => { if (!res) throw new Error('No existe este préstamo.'); if (!res.activo && res.idOperadorRegreso) throw new Error('Este préstamo ya no esta activo.'); - if (!res.Equipo.idStatus === 1) + if (res.Equipo.idStatus === 1) throw new Error('Aun no se ha entregado el equipo al usuario.'); diferencia = parseInt((ahora - moment(res.horaFin)) / 60000); if (diferencia >= 15) diff --git a/server/controller/Prestamo/regresarNumeroInventario.js b/server/controller/Prestamo/regresarNumeroInventario.js index dd071ed..490507b 100644 --- a/server/controller/Prestamo/regresarNumeroInventario.js +++ b/server/controller/Prestamo/regresarNumeroInventario.js @@ -46,7 +46,7 @@ const regresarNumeroInventario = async (body) => { .then(async (res) => { if (!res) throw new Error('No existe un prestamo activo con este equipo.'); - if (!res.Equipo.idStatus === 1) + if (res.Equipo.idStatus === 1) throw new Error('Aun no se ha entregado el equipo al usuario.'); idPrestamo = res.idPrestamo; diferencia = parseInt((ahora - moment(res.horaFin)) / 60000); diff --git a/server/controller/Prestamo/regresoInmediato.js b/server/controller/Prestamo/regresoInmediato.js index a040232..e490e20 100644 --- a/server/controller/Prestamo/regresoInmediato.js +++ b/server/controller/Prestamo/regresoInmediato.js @@ -20,7 +20,7 @@ const regresoInmediato = async (body) => { .then(async (res) => { if (!res) throw new Error('No existe este préstamo.'); if (!res.activo) throw new Error('Este préstamo ya no esta activo.'); - if (!res.Equipo.idStatus === 1) + if (res.Equipo.idStatus === 1) throw new Error('Aun no se ha entregado el equipo al usuario.'); diferencia = parseInt((ahora - moment(res.horaFin)) / 60000); if (diferencia >= 15) diff --git a/server/controller/Prestamo/regresoInmediatoNumeroInventario.js b/server/controller/Prestamo/regresoInmediatoNumeroInventario.js index 1434901..af8b5c0 100644 --- a/server/controller/Prestamo/regresoInmediatoNumeroInventario.js +++ b/server/controller/Prestamo/regresoInmediatoNumeroInventario.js @@ -26,7 +26,7 @@ const regresoInmediatoNumeroInventario = async (body) => { .then(async (res) => { if (!res) throw new Error('No existe este préstamo.'); if (!res.activo) throw new Error('Este préstamo ya no esta activo.'); - if (!res.Equipo.idStatus === 1) + if (res.Equipo.idStatus === 1) throw new Error('Aun no se ha entregado el equipo al usuario.'); diferencia = parseInt((ahora - moment(res.horaFin)) / 60000); if (diferencia >= 15)