style(malaysia): 랙 인쇄 레이아웃 — 번호 제거·용량 강조·박스 확대
- 인쇄/미리보기에서 랙 번호 제거(불필요) - 여백 축소(@page 4mm, 시트 2mm), 글자 전반 확대 - 상품명과 용량(750ml 등) 줄 분리, 용량을 최대(5.5cm)로 키워 원거리 가독 - 계산식의 박스 수(21box)를 굵게 3cm로 강조 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,12 @@
|
||||
function t(ko, en) { return lang() === "en" ? en : ko; }
|
||||
function fmt(n) { return Number(n || 0).toLocaleString(); }
|
||||
function nameOf(e) { return (lang() === "en" ? e.en : e.ko) || e.sku; }
|
||||
// 상품명 끝의 용량 토큰(숫자 포함, 예 750ml)을 분리 → {main, size}
|
||||
function splitName(full) {
|
||||
var m = String(full || "").match(/^(.*\S)\s+(\S*\d\S*)$/);
|
||||
if (m) return { main: m[1], size: m[2] };
|
||||
return { main: full || "", size: "" };
|
||||
}
|
||||
|
||||
function getEntries(cell) {
|
||||
try { return JSON.parse(cell.getAttribute("data-entries") || "[]"); }
|
||||
@@ -155,10 +161,6 @@
|
||||
var arr = getEntries(cell);
|
||||
var sheet = document.createElement("div");
|
||||
sheet.className = "rvp-sheet";
|
||||
var code = document.createElement("div");
|
||||
code.className = "rvp-cell-code";
|
||||
code.textContent = cell.getAttribute("data-cell");
|
||||
sheet.appendChild(code);
|
||||
var list = document.createElement("div");
|
||||
list.className = "rvp-list";
|
||||
if (!arr.length) {
|
||||
@@ -169,16 +171,24 @@
|
||||
} else {
|
||||
arr.forEach(function (e) {
|
||||
var total = (Number(e.upb) || 0) * (Number(e.box) || 0);
|
||||
var nm = splitName(nameOf(e));
|
||||
var line = document.createElement("div");
|
||||
line.className = "rvp-line";
|
||||
var nm = document.createElement("span");
|
||||
nm.className = "rvp-name";
|
||||
nm.textContent = nameOf(e);
|
||||
var main = document.createElement("span");
|
||||
main.className = "rvp-name";
|
||||
main.textContent = nm.main;
|
||||
line.appendChild(main);
|
||||
if (nm.size) {
|
||||
var size = document.createElement("span");
|
||||
size.className = "rvp-size";
|
||||
size.textContent = nm.size;
|
||||
line.appendChild(size);
|
||||
}
|
||||
var calc = document.createElement("span");
|
||||
calc.className = "rvp-calc";
|
||||
calc.textContent = fmt(e.upb) + t("개", "ea") + " × " + fmt(e.box)
|
||||
+ t("박스", "box") + " = " + fmt(total);
|
||||
line.appendChild(nm);
|
||||
calc.innerHTML = fmt(e.upb) + t("개", "ea") + " × "
|
||||
+ "<b class=\"rvp-box\">" + fmt(e.box) + t("박스", "box") + "</b>"
|
||||
+ " = " + fmt(total);
|
||||
line.appendChild(calc);
|
||||
list.appendChild(line);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user