diff --git a/server/controller/Prestamo/historial.js b/server/controller/Prestamo/historial.js index a6fae2d..6f787ed 100644 --- a/server/controller/Prestamo/historial.js +++ b/server/controller/Prestamo/historial.js @@ -30,6 +30,12 @@ const historial = async (body) => { if (idTipoCarrito) whereCarrito.push({ idTipoCarrito }); if (idModulo) whereCarrito.push({ idModulo }); return Prestamo.findAndCountAll({ + where: { + [Op.or]: [ + { activo: true }, + { [Op.and]: [{ activo: false }, { horaEntrega: { [Op.not]: null } }] }, + ], + }, include: [ { model: Equipo,