Add ticket paper width selector and improve thermal cut/print layout
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled

This commit is contained in:
2026-07-18 09:22:58 +00:00
parent f0c605f911
commit 8e6c1f2887
5 changed files with 35 additions and 16 deletions

View File

@@ -100,7 +100,8 @@ def generate_ticket(sale_data, business_info, width=80):
buf += 'Gracias por su compra!\n'.encode('cp437', errors='replace')
buf += 'Nexus Autoparts POS\n'.encode('cp437', errors='replace')
buf += b'\n\n\n'
buf += PARTIAL_CUT
buf += FEED + b'\x05' # Feed 5 lines before cutting
buf += CUT # Full cut
return bytes(buf)
@@ -187,7 +188,8 @@ def generate_quotation_ticket(quote_data, business_info, width=80):
buf += 'Precios sujetos a disponibilidad\n'.encode('cp437', errors='replace')
buf += 'Nexus Autoparts POS\n'.encode('cp437', errors='replace')
buf += b'\n\n\n'
buf += PARTIAL_CUT
buf += FEED + b'\x05'
buf += CUT
return bytes(buf)
@@ -338,6 +340,7 @@ def generate_service_order_ticket(so_data, business_info, width=80):
buf += "No es comprobante fiscal\n".encode("cp437", errors="replace")
buf += "Nexus Autoparts POS\n".encode("cp437", errors="replace")
buf += b"\n\n\n"
buf += PARTIAL_CUT
buf += FEED + b'\x05'
buf += CUT
return bytes(buf)