Return data in stamp
This commit is contained in:
parent
645560ef38
commit
d3c7c17f91
|
@ -78,8 +78,8 @@ class PACComercioDigital(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.error = ''
|
self.error = ''
|
||||||
self.cfdi_uuid = ''
|
# ~ self.cfdi_uuid = ''
|
||||||
self.date_stamped = ''
|
# ~ self.date_stamped = ''
|
||||||
|
|
||||||
def _error(self, msg):
|
def _error(self, msg):
|
||||||
self.error = str(msg)
|
self.error = str(msg)
|
||||||
|
@ -133,14 +133,19 @@ class PACComercioDigital(object):
|
||||||
|
|
||||||
xml = result.content
|
xml = result.content
|
||||||
tree = ET.fromstring(xml)
|
tree = ET.fromstring(xml)
|
||||||
self.cfdi_uuid = tree.xpath(
|
cfdi_uuid = tree.xpath(
|
||||||
'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@UUID)',
|
'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@UUID)',
|
||||||
namespaces=self.NS_CFDI)
|
namespaces=self.NS_CFDI)
|
||||||
self.date_stamped = tree.xpath(
|
date_stamped = tree.xpath(
|
||||||
'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@FechaTimbrado)',
|
'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@FechaTimbrado)',
|
||||||
namespaces=self.NS_CFDI)
|
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):
|
def _get_data_cancel(self, cfdi, info, auth):
|
||||||
NS_CFDI = {
|
NS_CFDI = {
|
||||||
|
|
Loading…
Reference in New Issue