update librerias
This commit is contained in:
+20
-18
@@ -72,7 +72,7 @@ export class MultaService {
|
||||
'No se mandó ningún motivo para multar a este alumno.',
|
||||
);
|
||||
return this.repository
|
||||
.findOne({ prestamo })
|
||||
.findOne({ where: { prestamo } })
|
||||
.then((existeMulta) => {
|
||||
if (existeMulta)
|
||||
throw new ConflictException(
|
||||
@@ -107,27 +107,29 @@ export class MultaService {
|
||||
desactivarMultas() {
|
||||
const ahora = moment();
|
||||
|
||||
return this.repository.find({ activo: true }).then(async (multas) => {
|
||||
for (let i = 0; i < multas.length; i++)
|
||||
if (ahora.diff(moment(multas[i].fecha_fin)) > 0) {
|
||||
const instituciones = multas[i].prestamo.usuario.instituciones;
|
||||
return this.repository
|
||||
.find({ where: { activo: true } })
|
||||
.then(async (multas) => {
|
||||
for (let i = 0; i < multas.length; i++)
|
||||
if (ahora.diff(moment(multas[i].fecha_fin)) > 0) {
|
||||
const instituciones = multas[i].prestamo.usuario.instituciones;
|
||||
|
||||
multas[i].activo = false;
|
||||
await this.repository.save(multas[i]);
|
||||
for (let j = 0; j < instituciones.length; j++) {
|
||||
const institucionUsuario = instituciones[j];
|
||||
multas[i].activo = false;
|
||||
await this.repository.save(multas[i]);
|
||||
for (let j = 0; j < instituciones.length; j++) {
|
||||
const institucionUsuario = instituciones[j];
|
||||
|
||||
if (
|
||||
institucionUsuario.institucionCarrera.institucion
|
||||
.id_institucion ===
|
||||
multas[i].opeardorMulta.institucion.id_institucion
|
||||
) {
|
||||
institucionUsuario.multa = false;
|
||||
await this.institucionUsuarioService.update(institucionUsuario);
|
||||
if (
|
||||
institucionUsuario.institucionCarrera.institucion
|
||||
.id_institucion ===
|
||||
multas[i].opeardorMulta.institucion.id_institucion
|
||||
) {
|
||||
institucionUsuario.multa = false;
|
||||
await this.institucionUsuarioService.update(institucionUsuario);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async findAll(filtros: {
|
||||
|
||||
Reference in New Issue
Block a user