diff --git a/api.py b/api.py index 828003c..49faf1b 100644 --- a/api.py +++ b/api.py @@ -31,7 +31,8 @@ def print_bill(data, address): printer.text(d["shop_address"]+'\n') printer.set(align='right', bold=False, height=1, width=1) printer.textln('========================') - if d['invoice']: + + if d['invoice'] and d['invoice']['resolution']: text = "Resolucion de Facturacion # "+str(d['invoice']['resolution']['resolution_number']) \ + "\nValida desde "+d['invoice']['resolution']['valid_date_time_from']+ \ " hasta "+str(d['invoice']['resolution']['valid_date_time_to'])