diff --git a/CHANGELOG.md b/CHANGELOG.md index 38d2fdb..8bcd5aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +v 1.24.0 [06-nov-2018] +---------------------- + - Fix: Consulta estatus SAT + + v 1.23.0 [30-oct-2018] ---------------------- - Mejora: Permitir importar CFDI 3.2 diff --git a/VERSION b/VERSION index a6c2798..53cc1a6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.23.0 +1.24.0 diff --git a/source/app/controllers/pac.py b/source/app/controllers/pac.py index 6add3bc..9242773 100644 --- a/source/app/controllers/pac.py +++ b/source/app/controllers/pac.py @@ -709,7 +709,7 @@ def _get_data_sat(path): print (e) return {} - return '?re={emisor}&rr={receptor}&tt={total}&id={uuid}'.format(**data) + return '?re={emisor}&rr={receptor}&tt={total}&id={uuid}'.format(**data) def get_status_sat(xml): @@ -717,14 +717,34 @@ def get_status_sat(xml): if not data: return 'XML inválido' - URL = 'https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl' - client = Client(URL, transport=Transport(cache=SqliteCache())) + data = """ + + + + + + {} + + + + """.format(data) + headers = { + 'SOAPAction': '"http://tempuri.org/IConsultaCFDIService/Consulta"', + 'Content-type': 'text/xml; charset="UTF-8"' + } + URL = 'https://consultaqr.facturaelectronica.sat.gob.mx/consultacfdiservice.svc' + try: - result = client.service.Consulta(expresionImpresa=data) + result = requests.post(URL, data=data, headers=headers) + tree = etree.fromstring(result.text) + node = tree.xpath("//*[local-name() = 'Estado']")[0] except Exception as e: return 'Error: {}'.format(str(e)) - return result.Estado + return node.text def main(): diff --git a/source/app/settings.py b/source/app/settings.py index 327591d..0a189e7 100644 --- a/source/app/settings.py +++ b/source/app/settings.py @@ -47,7 +47,7 @@ except ImportError: DEBUG = DEBUG -VERSION = '1.23.0' +VERSION = '1.24.0' EMAIL_SUPPORT = ('soporte@empresalibre.net',) TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)