diff --git a/app/routes/logs.py b/app/routes/logs.py index 8d987a9..b7457d1 100644 --- a/app/routes/logs.py +++ b/app/routes/logs.py @@ -219,7 +219,10 @@ async def resumen_page( rows = conn.execute(f""" SELECT - factura, tipo, contrato, cedula, idrecepcion, + factura, tipo, + MAX(contrato) AS contrato, + MIN(cedula) AS cedula, + MAX(idrecepcion) AS idrecepcion, COUNT(*) AS intentos, SUM(CASE WHEN status != 'error' THEN 1 ELSE 0 END) AS exitos, MIN(created_at) AS primer_envio, @@ -232,7 +235,7 @@ async def resumen_page( END AS estado_final FROM envios WHERE DATE(created_at) = ? {where_extra} - GROUP BY factura, tipo, contrato, cedula, idrecepcion + GROUP BY factura, tipo ORDER BY estado_final, tipo, factura """, params_q).fetchall()