diff --git a/pos/services/thermal_printer.py b/pos/services/thermal_printer.py index a20e8fd..e51354d 100644 --- a/pos/services/thermal_printer.py +++ b/pos/services/thermal_printer.py @@ -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) diff --git a/pos/static/js/config.js b/pos/static/js/config.js index da035bd..ac8483e 100644 --- a/pos/static/js/config.js +++ b/pos/static/js/config.js @@ -503,6 +503,7 @@ const Config = (() => { setVal('receipt-rfc', d.rfc); setVal('receipt-address', d.address); setVal('receipt-phone', d.phone); + setVal('receipt-paper-width', d.paper_width || '80'); setVal('receipt-thanks', d.thanks_message); setVal('receipt-footer', d.footer); setChecked('receipt-show-logo', d.show_logo); @@ -588,6 +589,7 @@ const Config = (() => { rfc: getVal('receipt-rfc'), address: getVal('receipt-address'), phone: getVal('receipt-phone'), + paper_width: getVal('receipt-paper-width') || '80', thanks_message: getVal('receipt-thanks'), footer: getVal('receipt-footer'), show_logo: getChecked('receipt-show-logo'), diff --git a/pos/static/js/pos.js b/pos/static/js/pos.js index 7890ff2..5adfb24 100644 --- a/pos/static/js/pos.js +++ b/pos/static/js/pos.js @@ -1664,7 +1664,11 @@ const POS = (() => { // Paper width: 58 mm -> 48 mm printable; 80 mm -> 72 mm printable. const paperWidth = parseInt(rc('paper_width', '80'), 10) || 80; - const printWidth = paperWidth === 58 ? 48 : 72; + const is58 = paperWidth === 58; + const printWidth = is58 ? 48 : 72; + const fontSize = is58 ? '7.5pt' : '9pt'; + const smallFont = is58 ? '6.5pt' : '8pt'; + const nameMax = is58 ? '18mm' : '34mm'; let iframe = document.getElementById('ticketPrintFrame'); if (!iframe) { @@ -1687,18 +1691,21 @@ const POS = (() => { diff --git a/pos/static/pwa/sw.js b/pos/static/pwa/sw.js index 64ac67e..6f979b4 100644 --- a/pos/static/pwa/sw.js +++ b/pos/static/pwa/sw.js @@ -6,7 +6,7 @@ // The fetch handler normalizes static asset URLs (strips ?v= query strings) // so templates can use cache-busting query params freely. -const VERSION = 46; +const VERSION = 47; const CACHE_NAME = 'nexus-pos-v' + VERSION; const APP_SHELL = [ diff --git a/pos/templates/config.html b/pos/templates/config.html index 4fccedf..a8c0a37 100644 --- a/pos/templates/config.html +++ b/pos/templates/config.html @@ -342,6 +342,13 @@ +
+ + +