diff --git a/source/app/controllers/cfdi_xml.py b/source/app/controllers/cfdi_xml.py index f02e587..85ea645 100644 --- a/source/app/controllers/cfdi_xml.py +++ b/source/app/controllers/cfdi_xml.py @@ -151,7 +151,8 @@ class CFDI(object): return '' self._comprobante(datos['comprobante']) - self._informacion_global(datos['global']) + if 'global' in datos: + self._informacion_global(datos['global']) self._relacionados(datos['relacionados']) self._emisor(datos['emisor']) self._receptor(datos['receptor']) diff --git a/source/app/controllers/main.py b/source/app/controllers/main.py index 522de05..d345455 100644 --- a/source/app/controllers/main.py +++ b/source/app/controllers/main.py @@ -542,13 +542,14 @@ class AppDocumentos(object): self._db = db def on_get(self, req, resp, type_doc, id_doc): + # ~ print('TD', type_doc) session = req.env['beaker.session'] req.context['result'], file_name, content_type = \ self._db.get_doc(type_doc, id_doc, session['rfc']) - if not type_doc in ('pdf', 'pre', 'tpdf', 'pdfpago', 'html'): + if not type_doc in ('pdf', 'pre', 'tpdf', 'pdfpago', 'html', 'nompdf'): resp.append_header('Content-Disposition', 'attachment; filename={}'.format(file_name)) - if type_doc in ('pdf',): + if type_doc in ('pdf', 'nompdf'): resp.append_header('Content-Disposition', 'inline; filename={}'.format(file_name)) resp.content_type = content_type diff --git a/source/app/settings.py b/source/app/settings.py index 986f01f..7058581 100644 --- a/source/app/settings.py +++ b/source/app/settings.py @@ -157,6 +157,7 @@ PRE = { 'LOCALES': '{http://www.sat.gob.mx/implocal}', 'NOMINA': { '1.1': '{http://www.sat.gob.mx/nomina}', + '1.2': '{http://www.sat.gob.mx/nomina12}', }, 'PAGOS': { '1.0': '{http://www.sat.gob.mx/Pagos}',