se mejora el acceso a doc.get('FolioPref') para que cuando sea None no de error
This commit is contained in:
1 parent
2be35d7e55
commit
839aad698d
1 file changed
+8
-8
@@ -146,14 +146,14 @@ def procesar_lote(token):
|
|||||||
if not _running:
|
if not _running:
|
||||||
return
|
return
|
||||||
|
|
||||||
ruc = doc.get("LicTradNum", "").strip()
|
ruc = (doc.get("LicTradNum") or "").strip()
|
||||||
tipo_cpe = doc.get("Indicator", "").strip()
|
tipo_cpe = (doc.get("Indicator") or "").strip()
|
||||||
serie = doc.get("FolioPref", "").strip()
|
serie = (doc.get("FolioPref") or "").strip()
|
||||||
numero = str(doc.get("FolioNum", "")).strip()
|
numero = doc.get("FolioNum") or 0
|
||||||
docentry = doc.get("DocEntry")
|
docentry = doc.get("DocEntry") or 0
|
||||||
docnum = doc.get("DocNum", "")
|
docnum = doc.get("DocNum") or 0
|
||||||
tiene_pdf = doc.get("tienePDF", "N")
|
tiene_pdf = (doc.get("tienePDF") or "N").strip()
|
||||||
tiene_xml = doc.get("tieneXML", "N")
|
tiene_xml = (doc.get("tieneXML") or "N").strip()
|
||||||
|
|
||||||
if not ruc or not tipo_cpe or not serie or not numero:
|
if not ruc or not tipo_cpe or not serie or not numero:
|
||||||
print(f" ⚠️ DocEntry={docentry} DocNum={docnum}: datos incompletos, saltando")
|
print(f" ⚠️ DocEntry={docentry} DocNum={docnum}: datos incompletos, saltando")
|
||||||
|
|||||||
Reference in new issue
Block a user