Cancel cfdi of pay with xml signed
This commit is contained in:
parent
8f15961d20
commit
90eec635ce
|
@ -669,6 +669,6 @@ def cancel_xml_sign(invoice, auth, certificado):
|
||||||
date_cancel = tree.xpath('string(//Acuse/@Fecha)')[:19]
|
date_cancel = tree.xpath('string(//Acuse/@Fecha)')[:19]
|
||||||
|
|
||||||
msg = 'Factura cancelada correctamente'
|
msg = 'Factura cancelada correctamente'
|
||||||
result = {'ok': True, 'msg': '', 'row': {'estatus': 'Cancelada'},
|
result = {'ok': True, 'msg': msg, 'row': {'estatus': 'Cancelada'},
|
||||||
'Fecha': date_cancel, 'Acuse': result}
|
'Fecha': date_cancel, 'Acuse': result}
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -6526,21 +6526,21 @@ class CfdiPagos(BaseModel):
|
||||||
data = {'ok': False, 'msg': msg}
|
data = {'ok': False, 'msg': msg}
|
||||||
return data
|
return data
|
||||||
|
|
||||||
auth = Emisor.get_auth()
|
auth = Configuracion.get_({'fields': 'pac_auth'})
|
||||||
cert = Certificado.get_cert()
|
certificado = Certificado.get(Certificado.es_fiel==False)
|
||||||
|
result = utils.cancel_xml_sign(last, auth, certificado)
|
||||||
data, result = util.cancel_xml(auth, last.uuid, cert)
|
# ~ data, result = util.cancel_xml(auth, last.uuid, cert)
|
||||||
if data['ok']:
|
if result['ok']:
|
||||||
last.estatus = 'Cancelada'
|
last.estatus = 'Cancelada'
|
||||||
last.error = ''
|
last.error = ''
|
||||||
last.cancelada = True
|
last.cancelada = True
|
||||||
last.fecha_cancelacion = result['Fecha']
|
last.fecha_cancelacion = result['Fecha']
|
||||||
msg = 'Factura cancelada correctamente'
|
# ~ msg = 'Factura cancelada correctamente'
|
||||||
else:
|
else:
|
||||||
last.error = msg = data['msg']
|
last.error = result['msg']
|
||||||
last.save()
|
last.save()
|
||||||
|
|
||||||
return {'ok': data['ok'], 'msg': msg, 'id': last.id}
|
return {'ok': result['ok'], 'msg': result['msg'], 'id': last.id}
|
||||||
|
|
||||||
def _get_folio(self, serie):
|
def _get_folio(self, serie):
|
||||||
folio = int(Configuracion.get_('txt_config_cfdipay_folio') or '0')
|
folio = int(Configuracion.get_('txt_config_cfdipay_folio') or '0')
|
||||||
|
@ -8587,7 +8587,6 @@ class CfdiNomina(BaseModel):
|
||||||
def _make_xml(self, cfdi):
|
def _make_xml(self, cfdi):
|
||||||
emisor = Emisor.select()[0]
|
emisor = Emisor.select()[0]
|
||||||
empleado = cfdi.empleado
|
empleado = cfdi.empleado
|
||||||
# ~ certificado = Certificado.select()[0]
|
|
||||||
certificado = Certificado.get(Certificado.es_fiel==False)
|
certificado = Certificado.get(Certificado.es_fiel==False)
|
||||||
totals = CfdiNominaTotales.select().where(CfdiNominaTotales.cfdi==cfdi)[0]
|
totals = CfdiNominaTotales.select().where(CfdiNominaTotales.cfdi==cfdi)[0]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue