feat: truncate cashier name on receipts and increase font size for order lines

This commit is contained in:
Suherdy Yacob 2026-06-01 08:49:11 +07:00
parent b446a2d54c
commit ea5e1d2cfc
2 changed files with 65 additions and 0 deletions

View File

@ -24,3 +24,43 @@
padding-bottom: 0 !important;
margin: 0 !important;
}
/* Enlarge order lines font size for high legibility (readable by 40+ years old) */
.pos-receipt .orderlines,
.pos-receipt .orderline,
.pos-receipt .pos-receipt-orderline,
.pos-receipt .orderlines li {
font-size: 135% !important;
font-weight: bold !important;
line-height: 1.3 !important;
}
.pos-receipt .orderline *,
.pos-receipt .pos-receipt-orderline *,
.pos-receipt .orderlines li * {
font-size: 100% !important;
font-weight: bold !important;
}
/* Styled notes for readability */
.pos-receipt .customer-note,
.pos-receipt .internal-note,
.pos-receipt .info-list,
.pos-receipt li.customer-note {
font-size: 110% !important;
font-weight: normal !important;
}
/* Force bottom padding/margins to 0 to prevent footer white spaces */
.pos-receipt {
padding-bottom: 0 !important;
margin-bottom: 0 !important;
}
@media print {
.pos-receipt {
padding-bottom: 0 !important;
margin-bottom: 0 !important;
}
}

View File

@ -2,6 +2,7 @@
import { patch } from "@web/core/utils/patch";
import { Orderline } from "@point_of_sale/app/components/orderline/orderline";
import { PosOrder } from "@point_of_sale/app/models/pos_order";
patch(Orderline.prototype, {
get lineScreenValues() {
@ -18,3 +19,27 @@ patch(Orderline.prototype, {
return res;
}
});
patch(PosOrder.prototype, {
getCashierName() {
const name = super.getCashierName();
if (!name) {
return name;
}
// Extract prefix if present (e.g. "Served by:", "Order Taker:")
let temp = name.trim();
let prefix = "";
const prefixMatch = temp.match(/^(served\s+by:?|order\s+taker:?|kasir:?)\s*/i);
if (prefixMatch) {
prefix = prefixMatch[0];
temp = temp.substring(prefix.length).trim();
}
const parts = temp.split(/\s+/);
if (parts.length <= 2) {
return name;
}
return prefix + parts[0] + " " + parts[parts.length - 1];
}
});