feat: add customer/kitchen note support and conditionally disable footer for basic receipts

This commit is contained in:
Suherdy Yacob 2026-05-29 11:10:22 +07:00
parent 8a33de6916
commit a4a2f936f4

View File

@ -260,6 +260,14 @@ export class EscPosGenerator {
itemLine = totalStr.padStart(W); itemLine = totalStr.padStart(W);
} }
cmds.push(...this.addLine(itemLine)); cmds.push(...this.addLine(itemLine));
// Line 3 (optional): customer note / kitchen note
if (line.note) {
const noteText = `* ${line.note}`;
cmds.push(...this.addLine(
noteText.length > W ? noteText.substring(0, W - 1) + '.' : noteText
));
}
}); });
cmds.push(...this.addLine(this.divider())); cmds.push(...this.addLine(this.divider()));
} }
@ -305,7 +313,8 @@ export class EscPosGenerator {
} }
// ── Footer ──────────────────────────────────────────────────────── // ── Footer ────────────────────────────────────────────────────────
if (receiptData.footerData) { // Skip footer on basic receipt (table checker) — matches pos_custom_receipt behaviour
if (!receiptData.isBasicReceipt && receiptData.footerData) {
const f = receiptData.footerData; const f = receiptData.footerData;
if (f.message) { if (f.message) {
cmds.push(...this.addLine(f.message, { align: 'center' })); cmds.push(...this.addLine(f.message, { align: 'center' }));