refactor: simplify receipt note processing by removing kitchen note parsing logic

This commit is contained in:
Suherdy Yacob 2026-06-02 20:17:08 +07:00
parent 0ca500fc01
commit e80bce30fa

View File

@ -748,26 +748,7 @@ patch(PosPrinterService.prototype, {
: (qty !== 0 ? lineTotal / qty : line.price_unit || 0); : (qty !== 0 ? lineTotal / qty : line.price_unit || 0);
// Customer-facing note (always shown, even on basic receipt) // Customer-facing note (always shown, even on basic receipt)
const customerNote = line.customer_note || ''; const note = line.customer_note || '';
// Kitchen/internal note — stored as JSON string: [{text:"..."},…]
// pos_custom_receipt reads this as internalNote for display
let kitchenNote = '';
if (line.note) {
try {
const tags = JSON.parse(line.note);
if (Array.isArray(tags)) {
kitchenNote = tags.map(t => t.text || '').filter(Boolean).join(', ');
} else {
kitchenNote = String(line.note);
}
} catch (_) {
kitchenNote = String(line.note);
}
}
// Combine notes (customer note takes priority; show both if both exist)
const note = [customerNote, kitchenNote].filter(Boolean).join(' | ');
// Find combo sub-lines linked to this line // Find combo sub-lines linked to this line
const comboSubLines = orderlines const comboSubLines = orderlines