style(malaysia): 랙 합계·∑ 천단위 콤마
- malaysia_rack.js: 행 소계/칸 합계 toLocaleString, 로드 시 기존 행도 recalc
- stocktake_detail/rack_view: 서버 렌더 합계도 {:,} 포맷
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -14,11 +14,15 @@
|
||||
return isNaN(v) || v < 0 ? 0 : v;
|
||||
}
|
||||
|
||||
function comma(n) {
|
||||
return n.toLocaleString("en-US");
|
||||
}
|
||||
|
||||
function recalcRow(row) {
|
||||
var upb = num(row.querySelector(".rk-upb"));
|
||||
var box = num(row.querySelector(".rk-box"));
|
||||
var sub = row.querySelector(".rk-sub");
|
||||
if (sub) sub.textContent = String(upb * box);
|
||||
if (sub) sub.textContent = comma(upb * box);
|
||||
}
|
||||
|
||||
function recalcCell(cell) {
|
||||
@@ -27,7 +31,7 @@
|
||||
total += num(row.querySelector(".rk-upb")) * num(row.querySelector(".rk-box"));
|
||||
});
|
||||
var out = cell.querySelector(".rk-cell-total-v");
|
||||
if (out) out.textContent = String(total);
|
||||
if (out) out.textContent = comma(total);
|
||||
}
|
||||
|
||||
function wireRow(row) {
|
||||
@@ -63,7 +67,10 @@
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
document.querySelectorAll(".rack-cell .rk-row").forEach(wireRow);
|
||||
document.querySelectorAll(".rack-cell .rk-row").forEach(function (row) {
|
||||
wireRow(row);
|
||||
recalcRow(row);
|
||||
});
|
||||
document.querySelectorAll(".rack-cell").forEach(recalcCell);
|
||||
document.querySelectorAll(".rack-cell .rk-add").forEach(function (btn) {
|
||||
btn.addEventListener("click", function () {
|
||||
|
||||
Reference in New Issue
Block a user