Agrega filtro convenio en automation/transaccion/test-rda y fix particular (contrato 12)
- automation: filtro contrato en SQL pacientes+RDA, numero LHXC en run() - transaccion: filtro contrato en preview/send-one/send - test-rda: filtro tipo_usuario (11/07/12), default contrato "12", acepta "12"/"012" - json_generator: detecta particular por CODCONTRATO "12"/"012" además de NIT_EMPRESA PART; fuerza tipousuario="12", codFormaPago="CLIP", plazoDias="0" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
d7afbe9b7d
commit
69372a5673
@@ -67,6 +67,7 @@ async def preview_transaccion(
|
||||
request: Request, user: dict = Depends(get_current_user),
|
||||
query_id: int = Form(...), factura: str = Form(""),
|
||||
fecha_inicio: str = Form(...), fecha_fin: str = Form(...),
|
||||
contrato: str = Form(""),
|
||||
):
|
||||
conn = get_connection()
|
||||
q = conn.execute("SELECT * FROM queries WHERE id = ?", (query_id,)).fetchone()
|
||||
@@ -82,6 +83,9 @@ async def preview_transaccion(
|
||||
return JSONResponse({"success": False, "message": "Sin datos"})
|
||||
|
||||
grupos = agrupar_por_recepcion(rows)
|
||||
if contrato:
|
||||
grupos = {k: v for k, v in grupos.items()
|
||||
if str(v[0].get("CODCONTRATO") or "").strip() == contrato.strip()}
|
||||
prof_def = cfg.get("profesional_default", "")
|
||||
esp_def = cfg.get("especialidad_default", "")
|
||||
remis_def = cfg.get("remisionante_default", "00")
|
||||
@@ -121,6 +125,7 @@ async def send_one(
|
||||
request: Request, user: dict = Depends(get_current_user),
|
||||
idrecepcion: int = Form(...), query_id: int = Form(...),
|
||||
factura: str = Form(""), fecha_inicio: str = Form(...), fecha_fin: str = Form(...),
|
||||
contrato: str = Form(""),
|
||||
):
|
||||
conn = get_connection()
|
||||
q = conn.execute("SELECT * FROM queries WHERE id = ?", (query_id,)).fetchone()
|
||||
@@ -204,7 +209,7 @@ async def send_transaccion(
|
||||
request: Request, user: dict = Depends(get_current_user),
|
||||
query_id: int = Form(...), factura: str = Form(""),
|
||||
fecha_inicio: str = Form(...), fecha_fin: str = Form(...),
|
||||
solo_pendientes: str = Form("0"),
|
||||
solo_pendientes: str = Form("0"), contrato: str = Form(""),
|
||||
):
|
||||
conn = get_connection()
|
||||
q = conn.execute("SELECT * FROM queries WHERE id = ?", (query_id,)).fetchone()
|
||||
@@ -218,6 +223,9 @@ async def send_transaccion(
|
||||
return JSONResponse({"success": False, "message": "Sin datos"})
|
||||
|
||||
grupos = agrupar_por_recepcion(rows)
|
||||
if contrato:
|
||||
grupos = {k: v for k, v in grupos.items()
|
||||
if str(v[0].get("CODCONTRATO") or "").strip() == contrato.strip()}
|
||||
if solo_pendientes == "1":
|
||||
grupos = {k: v for k, v in grupos.items() if not _is_sent(k)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user