Add receipt feed before QZ cutter

This commit is contained in:
metatroncubeswdev 2026-05-06 16:38:31 -04:00
parent 3e705e36a2
commit 8fc4ae447a
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
'name': 'Dine360 QZ Tray Printer', 'name': 'Dine360 QZ Tray Printer',
'version': '17.0.1.1', 'version': '17.0.1.2',
'category': 'Point of Sale', 'category': 'Point of Sale',
'summary': 'Integrate Odoo POS with Star/Epson Printers via QZ Tray.', 'summary': 'Integrate Odoo POS with Star/Epson Printers via QZ Tray.',
'depends': ['point_of_sale'], 'depends': ['point_of_sale'],

View File

@ -9,6 +9,7 @@ const GS = 0x1d;
const CR = 0x0d; const CR = 0x0d;
const LF = 0x0a; const LF = 0x0a;
const DEFAULT_COLUMNS = 42; const DEFAULT_COLUMNS = 42;
const END_FEED_LINES = 8;
function columnsFromConfig(config) { function columnsFromConfig(config) {
const value = Number.parseInt(config?.qz_paper_width || DEFAULT_COLUMNS, 10); const value = Number.parseInt(config?.qz_paper_width || DEFAULT_COLUMNS, 10);
@ -341,12 +342,14 @@ async function buildEscPosReceipt(order, pos) {
builder.line("THANK YOU"); builder.line("THANK YOU");
builder.bold(false); builder.bold(false);
builder.line("Please visit again"); builder.line("Please visit again");
builder.line("");
builder.line("Powered by Dine360"); builder.line("Powered by Dine360");
builder.align("left"); builder.align("left");
builder.feed(5); builder.feed(END_FEED_LINES);
if (config.qz_enable_cutter !== false) { if (config.qz_enable_cutter !== false) {
builder.cut(config.qz_cut_mode || "partial"); builder.cut(config.qz_cut_mode || "partial");
} }
builder.feed(1);
return bytesToBase64(builder.bytes); return bytesToBase64(builder.bytes);
} }