Timbrar y generar PDF con Cuenta Predial

This commit is contained in:
Mauricio Baeza 2017-12-06 23:30:40 -06:00
parent 9c4aebf3d8
commit 815548845c
3 changed files with 13 additions and 2 deletions

View File

@ -203,6 +203,7 @@ class CFDI(object):
complemento = {}
if 'complemento' in row:
complemento = row.pop('complemento')
cuenta_predial = row.pop('CuentaPredial', '')
taxes = {}
if 'impuestos' in row:
@ -234,8 +235,8 @@ class CFDI(object):
node_name = '{}:InformacionAduanera'.format(self._pre)
ET.SubElement(concepto, node_name, attributes)
if 'CuentaPredial' in row:
attributes = {'numero': row['CuentaPredial']}
if cuenta_predial:
attributes = {'Numero': cuenta_predial}
node_name = '{}:CuentaPredial'.format(self._pre)
ET.SubElement(concepto, node_name, attributes)

View File

@ -1033,6 +1033,12 @@ def _conceptos(doc, version):
values['noidentificacion'], values['ClaveProdServ'])
values['unidad'] = '({})\n{}'.format(
values['ClaveUnidad'], values['unidad'])
n = c.find('{}CuentaPredial'.format(PRE[version]))
if n is not None:
v = CaseInsensitiveDict(n.attrib.copy())
info = '\nCuenta Predial Número: {}'.format(v['numero'])
values['descripcion'] += info
data.append(values)
return data

View File

@ -2329,6 +2329,7 @@ class Facturas(BaseModel):
product['unidad'] = p.unidad.key
product['clave'] = p.clave
product['clave_sat'] = p.clave_sat
product['cuenta_predial'] = p.cuenta_predial
product['factura'] = invoice.id
product['producto'] = id_product
@ -2545,6 +2546,9 @@ class Facturas(BaseModel):
if row.descuento:
concepto['Descuento'] = FORMAT.format(row.descuento)
if row.cuenta_predial:
concepto['CuentaPredial'] = row.cuenta_predial
taxes = {}
traslados = []
retenciones = []