fix print data in invoice

This commit is contained in:
Wilson Gomez 2023-11-08 14:52:15 -05:00
parent c36e7277d5
commit 418856a116
1 changed files with 9 additions and 2 deletions

View File

@ -656,9 +656,15 @@ class Receipt(object):
self._printer.set(align='left')
if type_doc == 'invoice':
if sale['number']:
text_title = ""
invoice_type = sale.get('invoice_type', '')
if invoice_type == 'P':
text_title = "SISTEMA POS: "
elif invoice_type == '1':
text_title = "FACTURA DE VENTA ELECTRONICA: "
if sale['total_amount'] >= 0:
self._printer.text(
'FACTURA DE VENTA No. ' + sale['number'])
text_title + sale['number'])
else:
self._printer.text('NOTA CREDITO No. ' + sale['number'])
elif type_doc in ['order', 'delivery']:
@ -1049,12 +1055,13 @@ class Receipt(object):
res = ''
kind = auth['kind']
start_date_auth = auth['start_date_auth']
end_date_auth = auth['end_date_auth']
from_auth = auth['from_auth']
to_auth = auth['to_auth']
number = auth['number']
prefix = auth.get('prefix', "")
if auth:
res = f"Autorizacion de facturacion {kind} No {number} del {start_date_auth}, prefijo {prefix} habilita desde {from_auth} a {to_auth}"
res = f"Autorizacion de facturacion {kind} No {number} del {start_date_auth} hasta {end_date_auth}, habilita desde {prefix} {from_auth} a {prefix} {to_auth}"
return res