feat: resolve exam prices via TARIFA+EMPRESA JOIN, show company name

- PRECIO now falls back to catalog price (TARIFA) when 0/null
- JOIN EMPRESA + EMPRESA_SUB + TARIFA in exam query
- NOM_EMPRESA propagated to log and historial display

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-18 14:58:10 -05:00
co-authored by Claude Sonnet 4.6
parent 7aa02fe6ac
commit 6cbf0732e6
3 changed files with 24 additions and 15 deletions
+1
View File
@@ -39,6 +39,7 @@ def guardar_sync_log(
"diagnostico_cod": d.get("diagnostico_cod", ""),
"diagnostico_nombre": d.get("diagnostico_nombre", ""),
"nit_empresa": d.get("nit_empresa", ""),
"nom_empresa": d.get("nom_empresa", ""),
"valor_total": d.get("valor_total"),
"examenes_det": d.get("examenes_det", []),
} for d in detalle_raw],