From c0e66989ca99ccecb6c1fca908bc86219f0f1da0 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 28 Jul 2026 17:23:16 -0500 Subject: [PATCH] fix: ventas page only shows CMXC records, remove duplicate column - _query_rows now always filters by PREFIJO='CMXC' (unless user specifies another prefix in the factura field) - Removed redundant first column IDRECEP from ventas table (factura_key and factura were identical) - Renamed header to just Factura Co-Authored-By: Claude Sonnet 4.6 --- app/routes/ventas.py | 5 +++-- app/templates/ventas.html | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/routes/ventas.py b/app/routes/ventas.py index ed3d097..288fad8 100644 --- a/app/routes/ventas.py +++ b/app/routes/ventas.py @@ -43,8 +43,9 @@ def _query_rows(cfg, query_text, factura, fecha_inicio, fecha_fin): if not ok2: return None, err - if prefix and rows and "PREFIJO" in rows[0]: - rows = [r for r in rows if str(r.get("PREFIJO") or "").strip().upper() == prefix] + if rows and "PREFIJO" in rows[0]: + filter_prefix = prefix if prefix else "CMXC" + rows = [r for r in rows if str(r.get("PREFIJO") or "").strip().upper() == filter_prefix] return rows, None diff --git a/app/templates/ventas.html b/app/templates/ventas.html index cff4287..e20b1f0 100644 --- a/app/templates/ventas.html +++ b/app/templates/ventas.html @@ -175,7 +175,6 @@ function renderTabla() { let html = `
- @@ -220,7 +219,6 @@ function filaHtml(item) { return ` -
IDRECEP. Factura Paciente Contrato
${escHtml(id)}${escHtml(String(item.factura || '-'))} ${escHtml(String(item.paciente || '-'))} ${escHtml(String(item.contrato || '-'))} ${escHtml(examsStr)}