forked from elmau/empresa-libre
Fix - fecha DOF en PDF de donativo
This commit is contained in:
parent
8d878e3731
commit
8c9f0092dc
|
@ -1113,13 +1113,14 @@ def _timbre(doc, version, values):
|
|||
return data
|
||||
|
||||
|
||||
def _donataria(doc, version):
|
||||
def _donataria(doc, version, fechadof):
|
||||
node = doc.find('{}Complemento/{}Donatarias'.format(
|
||||
PRE[version], PRE['DONATARIA']))
|
||||
if node is None:
|
||||
return {}
|
||||
|
||||
data = CaseInsensitiveDict(node.attrib.copy())
|
||||
data['fechadof'] = fechadof
|
||||
return data
|
||||
|
||||
|
||||
|
@ -1132,7 +1133,7 @@ def get_data_from_xml(invoice, values):
|
|||
data['receptor'] = _receptor(doc, version, values)
|
||||
data['conceptos'] = _conceptos(doc, version)
|
||||
data['totales'] = _totales(doc, data['comprobante'], version)
|
||||
data['donataria'] = _donataria(doc, version)
|
||||
data['donataria'] = _donataria(doc, version, values['fechadof'])
|
||||
|
||||
options = {
|
||||
'rfc_emisor': data['emisor']['rfc'],
|
||||
|
|
|
@ -1896,7 +1896,7 @@ class Facturas(BaseModel):
|
|||
|
||||
return data
|
||||
|
||||
def _get_not_in_xml(self, invoice):
|
||||
def _get_not_in_xml(self, invoice, emisor):
|
||||
values = {}
|
||||
|
||||
if invoice.version == '3.2':
|
||||
|
@ -1925,6 +1925,8 @@ class Facturas(BaseModel):
|
|||
obj = SATTipoRelacion.get(SATTipoRelacion.key==invoice.tipo_relacion)
|
||||
values['tiporelacion'] = str(obj)
|
||||
|
||||
values['fechadof'] = str(emisor.fecha_dof)
|
||||
|
||||
return values
|
||||
|
||||
@classmethod
|
||||
|
@ -1935,7 +1937,7 @@ class Facturas(BaseModel):
|
|||
if obj.uuid is None:
|
||||
return b'', name
|
||||
|
||||
values = cls._get_not_in_xml(cls, obj)
|
||||
values = cls._get_not_in_xml(cls, obj, emisor)
|
||||
data = util.get_data_from_xml(obj, values)
|
||||
doc = util.to_pdf(data, emisor.rfc)
|
||||
return doc, name
|
||||
|
|
Loading…
Reference in New Issue