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:
@@ -61,13 +61,13 @@
|
||||
<div class="rv-cell {% if not entries %}is-empty{% endif %}">
|
||||
<div class="rv-cell-head">
|
||||
<span>{{ cell }}</span>
|
||||
<span class="rv-total">∑ {{ ns.total }}</span>
|
||||
<span class="rv-total">∑ {{ "{:,}".format(ns.total) }}</span>
|
||||
</div>
|
||||
<div class="rv-items">
|
||||
{% for e in entries %}
|
||||
<div class="rv-item">
|
||||
<span class="rv-name" data-en="{{ e.item_name }}" data-ko="{{ ko_names.get(e.sku_code, e.item_name) }}">{{ e.item_name }}</span><br>
|
||||
<span class="rv-calc">{{ e.box_count }}<span class="i18n">박스</span> × {{ e.units_per_box }} = <span class="rv-qty">{{ e.total }}</span></span>
|
||||
<span class="rv-calc">{{ e.box_count }}<span class="i18n">박스</span> × {{ e.units_per_box }} = <span class="rv-qty">{{ "{:,}".format(e.total) }}</span></span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if not entries %}<span class="rv-empty-note">—</span>{% endif %}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<input class="erp-input rk-box" type="number" min="1" name="rk_box"
|
||||
value="{{ entry.box_count if entry else '' }}" {% if disabled %}disabled{% endif %} /></label>
|
||||
<div class="rk-foot">
|
||||
<span><span class="i18n">합계</span> <b class="rk-sub">{{ (entry.units_per_box * entry.box_count) if entry else 0 }}</b></span>
|
||||
<span><span class="i18n">합계</span> <b class="rk-sub">{{ "{:,}".format(entry.units_per_box * entry.box_count) if entry else 0 }}</b></span>
|
||||
{% if not disabled %}<button type="button" class="rk-del" title="행 삭제">× <span class="i18n">삭제</span></button>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,5 +193,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script src="/static/malaysia_rack.js?v=20260614a"></script>
|
||||
<script src="/static/malaysia_rack.js?v=20260614b"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -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