erorr en regreso sin entrega previa
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user