feat(cupang): 출고 박스 구성(box_plan) 저장 + 달력 상세를 센터 분배 형식으로

- 마이그레이션 005: cupang_shipments.box_plan JSONB (확정 당시 박스 구성)
  확정 payload 에서 제품별/혼합 상자와 내용물·상자 종류를 받아 저장
- 달력 오른쪽 목록을 ③ 센터 분배 카드 형식으로 변경 — 혼합 상자는
  내용물 트리까지 표시. box_plan 이 없는 예전 출고는 기존 합계 표시로 폴백
- 출고 보기(view.html) ③ 목록도 동일하게 box_plan 기준

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-01 15:58:29 +09:00
parent 8c8f6aebb2
commit 1c1ca69feb
12 changed files with 226 additions and 36 deletions
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260901m" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260901n" />{% endblock %}
{% block content %}
<section class="cpg">
@@ -1254,11 +1254,39 @@
return t + ", " + byType[t] + "개";
}).join(" / ");
// 확정 후 상세 화면에서 "어느 상자에 무엇이" 를 보여주기 위한 스냅샷
var boxPlan = rows.map(function (a) {
if (a.key.indexOf("m:") === 0) {
return {
kind: "mix",
name: labels[a.key] || a.key,
box_type: mixTypeOf(a.key),
count: a.count,
units: units[a.key] || 0,
items: (contents[a.key] || []).map(function (it) {
return {
product_code: it.product_code,
product_name: it.product_name,
quantity: it.quantity * a.count
};
})
};
}
return {
kind: "product",
name: labels[a.key] || a.key,
product_code: a.key.slice(2),
count: a.count,
units: units[a.key] || 0
};
});
return {
center_id: cid,
ship_method: methods[String(cid)] || "",
boxes: boxes,
box_summary: boxSummary,
box_plan: boxPlan,
items: items
};
});