Fix - Issue #185

This commit is contained in:
Mauricio Baeza 2018-02-13 11:42:38 -06:00
parent ac4df43835
commit a1a17732e8
1 changed files with 11 additions and 8 deletions

View File

@ -1379,7 +1379,6 @@ def to_letters(value, moneda):
def get_qr(data):
# ~ path = tempfile.mkstemp()[1]
path = get_path_temp('.qr')
qr = pyqrcode.create(data, mode='binary')
qr.png(path, scale=7)
@ -1621,14 +1620,18 @@ def _timbre(doc, version, values):
node = doc.find('{}Complemento/{}TimbreFiscalDigital'.format(
PRE[version], PRE['TIMBRE']))
data = CaseInsensitiveDict(node.attrib.copy())
total_s = '%017.06f' % float(values['total'])
qr_data = '?re=%s&rr=%s&tt=%s&id=%s' % (
values['rfc_emisor'],
values['rfc_receptor'],
total_s,
node.attrib['UUID'])
qr_data = {
'url': 'https://verificacfdi.facturaelectronica.sat.gob.mx/default.aspx?',
'uuid': '&id={}'.format(data['uuid']),
'emisor': '&re={}'.format(values['rfc_emisor']),
'receptor': '&rr={}'.format(values['rfc_receptor']),
'total': '&tt={}'.format(values['total']),
'sello': '&fe={}'.format(data['sellocfd'][-8:]),
}
qr_data = '{url}{uuid}{emisor}{receptor}{total}{sello}'.format(**qr_data)
data['path_cbb'] = get_qr(qr_data)
data['cadenaoriginal'] = CADENA.format(**node.attrib)
data['cadenaoriginal'] = CADENA.format(**data)
return data