diff --git a/backend/app/repositories/access_repository.py b/backend/app/repositories/access_repository.py index 0039595..498f24f 100644 --- a/backend/app/repositories/access_repository.py +++ b/backend/app/repositories/access_repository.py @@ -442,7 +442,8 @@ class AccessRepository: COALESCE(d.Documento, '') AS Documento, pat.Valor AS Patente, lot.Valor AS LoteCodigo, - COALESCE(cch.Valor, '0') AS CacheoSalida + COALESCE(cch.Valor, '0') AS CacheoSalida, + (SELECT COUNT(*) FROM tckper WHERE TicketID = t.TicketID) AS CantidadOcupantes FROM tck t LEFT JOIN mdl m ON t.ModuloIngresoID = m.ModuloID LEFT JOIN tckper tp ON t.TicketID = tp.TicketID @@ -451,7 +452,7 @@ class AccessRepository: LEFT JOIN tckprx pat ON t.TicketID = pat.TicketID AND pat.PropiedadID = 4 LEFT JOIN tckprx lot ON t.TicketID = lot.TicketID AND lot.PropiedadID = 7 LEFT JOIN tckprx cch ON t.TicketID = cch.TicketID AND cch.PropiedadID = 6 - ORDER BY t.FechaHoraIngreso DESC + ORDER BY t.FechaHoraIngreso DESC, tp.RolID ASC """ with db_session() as conn: cursor = conn.cursor(as_dict=True) diff --git a/backend/app/services/access_service.py b/backend/app/services/access_service.py index 909a2bc..73ae847 100644 --- a/backend/app/services/access_service.py +++ b/backend/app/services/access_service.py @@ -282,7 +282,7 @@ class AccessService: lote_codigo=f.get("LoteCodigo"), modulo_ingreso=str(f.get("ModuloIngreso") or "Módulo Desconocido"), fecha_ingreso=f_ing_str, - ocupantes=1, + ocupantes=int(f.get("CantidadOcupantes") or 1), cacheo_salida=str(f.get("CacheoSalida") or "0") == "1", ) ) diff --git a/frontend/index.html b/frontend/index.html index 70a7a5a..503d92b 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -12,7 +12,8 @@ - + +