fix: agregar codigosucursal al endpoint de ventas en automation

TNS requiere ?codigosucursal= en /v2/facturacion/Ventas/Crear igual que en RdaPaciente/Insertar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-24 10:21:05 -05:00
co-authored by Claude Sonnet 4.6
parent 6950e5aaed
commit 2525e053bf
+1 -1
View File
@@ -740,7 +740,7 @@ async def run_automation(
and int(v[0].get("NUM_FACTURA") or 0) != 0}
resultado["paso4_ventas"]["excluidos"] = len(grupos_vta_all) - len(grupos_vta)
endpoint_venta = f"{TNS_BASE}/v2/facturacion/Ventas/Crear"
endpoint_venta = f"{TNS_BASE}/v2/facturacion/Ventas/Crear?codigosucursal={api_sucursal or '00'}"
if "ventas" in pasos_set:
async with httpx.AsyncClient(timeout=timeout) as client:
for id_rec, grupo_rows in grupos_vta.items():