fix: add ?codigosucursal to Ventas/Crear URL in ventas.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-28 19:07:27 -05:00
co-authored by Claude Sonnet 4.6
parent b5b6258270
commit f4f135ba29
+4 -2
View File
@@ -236,7 +236,8 @@ async def send_one(
return JSONResponse({"success": False, "message": f"Error login TNS: {token_err}"})
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {token}"}
endpoint = f"{TNS_BASE}/v2/facturacion/Ventas/Crear"
api_sucursal = cfg.get("api_sucursal", "") or "00"
endpoint = f"{TNS_BASE}/v2/facturacion/Ventas/Crear?codigosucursal={api_sucursal}"
venta_json = _build_venta(grupo_rows, cfg)
contrato = str(grupo_rows[0].get("CODCONTRATO") or "").strip()
@@ -287,7 +288,8 @@ async def send_ventas(
return JSONResponse({"success": False, "message": f"Error login TNS: {token_err}"})
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {token}"}
endpoint = f"{TNS_BASE}/v2/facturacion/Ventas/Crear"
api_sucursal = cfg.get("api_sucursal", "") or "00"
endpoint = f"{TNS_BASE}/v2/facturacion/Ventas/Crear?codigosucursal={api_sucursal}"
resultados = []
async with httpx.AsyncClient(timeout=int(cfg.get("api_timeout", 30))) as client: