Fix get status sat, issue #422
This commit is contained in:
commit
b03fbebe09
|
@ -1,4 +1,4 @@
|
||||||
v 1.40.1 [10-Feb-2021]
|
v 1.40.1 [09-Feb-2021]
|
||||||
----------------------
|
----------------------
|
||||||
- Fix #422
|
- Fix #422
|
||||||
|
|
||||||
|
|
|
@ -705,7 +705,7 @@ def _get_data_sat(xml):
|
||||||
BF = 'string(//*[local-name()="{}"]/@{})'
|
BF = 'string(//*[local-name()="{}"]/@{})'
|
||||||
NS_CFDI = {'cfdi': 'http://www.sat.gob.mx/cfd/3'}
|
NS_CFDI = {'cfdi': 'http://www.sat.gob.mx/cfd/3'}
|
||||||
|
|
||||||
# ~ try:
|
try:
|
||||||
tree = ET.fromstring(xml.encode())
|
tree = ET.fromstring(xml.encode())
|
||||||
emisor = escape(
|
emisor = escape(
|
||||||
tree.xpath('string(//cfdi:Emisor/@rfc)', namespaces=NS_CFDI) or
|
tree.xpath('string(//cfdi:Emisor/@rfc)', namespaces=NS_CFDI) or
|
||||||
|
@ -717,8 +717,8 @@ def _get_data_sat(xml):
|
||||||
)
|
)
|
||||||
total = tree.get('total') or tree.get('Total')
|
total = tree.get('total') or tree.get('Total')
|
||||||
uuid = tree.xpath(BF.format('TimbreFiscalDigital', 'UUID'))
|
uuid = tree.xpath(BF.format('TimbreFiscalDigital', 'UUID'))
|
||||||
# ~ except Exception as e:
|
except Exception as e:
|
||||||
# ~ return ''
|
return ''
|
||||||
|
|
||||||
data = f'?re={emisor}&rr={receptor}&tt={total}&id={uuid}'
|
data = f'?re={emisor}&rr={receptor}&tt={total}&id={uuid}'
|
||||||
return data
|
return data
|
||||||
|
|
Loading…
Reference in New Issue