erorr en regreso sin entrega previa

This commit is contained in:
xXpuma99Xx
2022-02-03 12:04:14 -06:00
parent 658f37820d
commit 1d5eaf8c97
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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)
@@ -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);
@@ -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)
@@ -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)