forked from elmau/empresa-libre
Fix - Issue #185
This commit is contained in:
parent
ac4df43835
commit
a1a17732e8
|
@ -1379,7 +1379,6 @@ def to_letters(value, moneda):
|
||||||
|
|
||||||
|
|
||||||
def get_qr(data):
|
def get_qr(data):
|
||||||
# ~ path = tempfile.mkstemp()[1]
|
|
||||||
path = get_path_temp('.qr')
|
path = get_path_temp('.qr')
|
||||||
qr = pyqrcode.create(data, mode='binary')
|
qr = pyqrcode.create(data, mode='binary')
|
||||||
qr.png(path, scale=7)
|
qr.png(path, scale=7)
|
||||||
|
@ -1621,14 +1620,18 @@ def _timbre(doc, version, values):
|
||||||
node = doc.find('{}Complemento/{}TimbreFiscalDigital'.format(
|
node = doc.find('{}Complemento/{}TimbreFiscalDigital'.format(
|
||||||
PRE[version], PRE['TIMBRE']))
|
PRE[version], PRE['TIMBRE']))
|
||||||
data = CaseInsensitiveDict(node.attrib.copy())
|
data = CaseInsensitiveDict(node.attrib.copy())
|
||||||
total_s = '%017.06f' % float(values['total'])
|
|
||||||
qr_data = '?re=%s&rr=%s&tt=%s&id=%s' % (
|
qr_data = {
|
||||||
values['rfc_emisor'],
|
'url': 'https://verificacfdi.facturaelectronica.sat.gob.mx/default.aspx?',
|
||||||
values['rfc_receptor'],
|
'uuid': '&id={}'.format(data['uuid']),
|
||||||
total_s,
|
'emisor': '&re={}'.format(values['rfc_emisor']),
|
||||||
node.attrib['UUID'])
|
'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['path_cbb'] = get_qr(qr_data)
|
||||||
data['cadenaoriginal'] = CADENA.format(**node.attrib)
|
data['cadenaoriginal'] = CADENA.format(**data)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue