From 839aad698d5944a457bf9a83e3ca104f3c004d56 Mon Sep 17 00:00:00 2001 From: George Date: Mon, 3 Aug 2026 10:19:09 -0500 Subject: [PATCH] se mejora el acceso a doc.get('FolioPref') para que cuando sea None no de error --- main.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index 46e9448..398f613 100644 --- a/main.py +++ b/main.py @@ -146,14 +146,14 @@ def procesar_lote(token): if not _running: return - ruc = doc.get("LicTradNum", "").strip() - tipo_cpe = doc.get("Indicator", "").strip() - serie = doc.get("FolioPref", "").strip() - numero = str(doc.get("FolioNum", "")).strip() - docentry = doc.get("DocEntry") - docnum = doc.get("DocNum", "") - tiene_pdf = doc.get("tienePDF", "N") - tiene_xml = doc.get("tieneXML", "N") + ruc = (doc.get("LicTradNum") or "").strip() + tipo_cpe = (doc.get("Indicator") or "").strip() + serie = (doc.get("FolioPref") or "").strip() + numero = doc.get("FolioNum") or 0 + docentry = doc.get("DocEntry") or 0 + docnum = doc.get("DocNum") or 0 + tiene_pdf = (doc.get("tienePDF") or "N").strip() + tiene_xml = (doc.get("tieneXML") or "N").strip() if not ruc or not tipo_cpe or not serie or not numero: print(f" ⚠️ DocEntry={docentry} DocNum={docnum}: datos incompletos, saltando")