Return data in stamp

This commit is contained in:
Mauricio Baeza 2020-12-29 22:12:02 -06:00
parent 645560ef38
commit d3c7c17f91
1 changed files with 10 additions and 5 deletions

View File

@ -78,8 +78,8 @@ class PACComercioDigital(object):
def __init__(self):
self.error = ''
self.cfdi_uuid = ''
self.date_stamped = ''
# ~ self.cfdi_uuid = ''
# ~ self.date_stamped = ''
def _error(self, msg):
self.error = str(msg)
@ -133,14 +133,19 @@ class PACComercioDigital(object):
xml = result.content
tree = ET.fromstring(xml)
self.cfdi_uuid = tree.xpath(
cfdi_uuid = tree.xpath(
'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@UUID)',
namespaces=self.NS_CFDI)
self.date_stamped = tree.xpath(
date_stamped = tree.xpath(
'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@FechaTimbrado)',
namespaces=self.NS_CFDI)
return xml.decode()
data = {
'xml': xml.decode(),
'uuid': cfdi_uuid,
'date': date_stamped,
}
return data
def _get_data_cancel(self, cfdi, info, auth):
NS_CFDI = {