diff --git a/app/modules/malaysia/templates/malaysia/rack_view.html b/app/modules/malaysia/templates/malaysia/rack_view.html index 3303186..7c493f5 100644 --- a/app/modules/malaysia/templates/malaysia/rack_view.html +++ b/app/modules/malaysia/templates/malaysia/rack_view.html @@ -61,13 +61,13 @@
{{ cell }} - ∑ {{ ns.total }} + ∑ {{ "{:,}".format(ns.total) }}
{% for e in entries %}
{{ e.item_name }}
- {{ e.box_count }}박스 × {{ e.units_per_box }} = {{ e.total }} + {{ e.box_count }}박스 × {{ e.units_per_box }} = {{ "{:,}".format(e.total) }}
{% endfor %} {% if not entries %}{% endif %} diff --git a/app/modules/malaysia/templates/malaysia/stocktake_detail.html b/app/modules/malaysia/templates/malaysia/stocktake_detail.html index 3c4e643..99794c0 100644 --- a/app/modules/malaysia/templates/malaysia/stocktake_detail.html +++ b/app/modules/malaysia/templates/malaysia/stocktake_detail.html @@ -16,7 +16,7 @@
- 합계 {{ (entry.units_per_box * entry.box_count) if entry else 0 }} + 합계 {{ "{:,}".format(entry.units_per_box * entry.box_count) if entry else 0 }} {% if not disabled %}{% endif %}
@@ -193,5 +193,5 @@
- + {% endblock %} diff --git a/app/static/malaysia_rack.js b/app/static/malaysia_rack.js index 0f5a40a..4a61c5b 100644 --- a/app/static/malaysia_rack.js +++ b/app/static/malaysia_rack.js @@ -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 () {