fixed detalle_servicio and recibo

This commit is contained in:
2026-01-16 15:32:05 -06:00
parent 19dacc38ae
commit 0bbac3b9b3
2 changed files with 19 additions and 11 deletions
+16 -8
View File
@@ -25,14 +25,22 @@ export class ReciboService {
}
async findByDateRange(desde: string, hasta: string) {
const fechaDesde = new Date(desde);
const fechaHasta = new Date(hasta);
return await this.reciboRepository.find({
where: {
fecha_recibo: Between(fechaDesde, fechaHasta),
},
});
return this.reciboRepository
.createQueryBuilder('recibo')
.leftJoin('recibo.user', 'user')
.select([
'recibo.id_recibo',
'recibo.folio_recibo',
'recibo.monto',
'recibo.fecha_recibo',
'recibo.fecha_registro',
'user.usuario',
])
.where('recibo.fecha_recibo >= :inicio', { inicio: desde })
.andWhere('recibo.fecha_recibo < DATE_ADD(:fin, INTERVAL 1 DAY)', {
fin: hasta,
})
.getMany();
}
}
//IO