fix(M02): 일위대가 목록 합계 · 단위 · 새 항목 두 단추 — 수량 없으면 기준 합(작은 글 「기준」) · 담은 로직 0 「—」 · 단위 = 일위대가 문서 단위 · 누른 단추가 진하게

39-8 B2 · B3 · B4 — 서버 목록 칸 labor 에 기준 · 단위 · laborSum · Col note · buildTwoWay choose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
2026-10-04 22:05:58 +09:00
co-authored by Claude Opus 5.5
parent 26a24889e6
commit d4458ec894
5 changed files with 96 additions and 18 deletions
+8 -1
View File
@@ -33,7 +33,7 @@ const row = (열, 경로, extra = {}) => ({
});
const rows = [
row("c1", ["기슭막이", "메쌓기", "1.2m"], {
labor: { 번호: "SU-000001", 로직수: 3, 합계: 1234567.4 },
labor: { 번호: "SU-000001", 로직수: 3, 합계: 1234567.4, 기준: 99, 단위: "개소" },
수정일: { structure: "2026-10-01T09:00:00", labor: "2026-10-04T11:00:00" },
}),
row("c2", ["기슭막이", "찰쌓기"], { labor: { 번호: "SU-000002", 로직수: 0, 합계: null } }),
@@ -62,6 +62,13 @@ process.stdout.write(
pageOver: m.pageOf(many, m.ITEM_COLS.structure, "", 9).page,
pageEmpty: m.pageOf([], m.ITEM_COLS.structure, "", 2).page,
// 그 부분 문서 없는 줄(39-8 H3) — c1 = 일위대가 있음 · 면적 수정일 없음 · c3 = 수정일 · 일위대가 없음
sums: [
rows[0], // 반영 합 있음
{ labor: { 로직수: 14, 합계: 0, 기준: 167746.6 } }, // 수량 없음 = 기준
rows[1], // 담은 로직 0
{ labor: { 로직수: 2, 합계: null, 기준: null } }, // 계산값 없음
rows[2], // 일위대가 없음
].map((r) => m.laborSum(r)),
missing: ["structure", "area", "labor", "item"].map((k) =>
rows.map((r) => m.missingPart(k, r)),
),
+29 -4
View File
@@ -54,11 +54,23 @@ def test_칸_값_빈_번호_합계_날짜(ts):
s, labor = ts["cells"]["structure"], ts["cells"]["labor"]
assert s[0] == ["SD-c1", "1.2m", "기슭막이 / 메쌓기", "m", "2026-10-01"]
assert s[2][0] == "—" and s[2][2] == "" # 빈 도번 · 맨 위 항목(폴더 없음)
assert labor[0][3:] == ["m", "3", "1,234,567", "2026-10-04"] # 합계 원 단위 반올림
assert labor[0][3:] == ["개소", "3", "1,234,567", "2026-10-04"] # 일위대가 단위 · 원 단위
assert labor[1][5] == "—" and labor[2][0] == labor[2][4] == "—" # 합계 없음 · 일위대가 없음
assert ts["cells"]["item"][0][-1] == "2026-10-04" # 항목 통째 = 가장 늦게 고친 날
def test_일위대가_합계_반영_기준_빈(ts):
"""39-8 B2 — 반영 합이 있으면 그것 · 없으면 기준 합 + 「기준」 ·
담은 로직 0 · 계산값 없음 = 「—」."""
assert ts["sums"] == [
{"text": "1,234,567", "note": ""},
{"text": "167,747", "note": "기준"},
{"text": "—", "note": ""},
{"text": "—", "note": ""},
{"text": "—", "note": ""},
]
def test_찾기_쪽(ts):
assert ts["find"] == ["c2"] # 낱말 둘 AND(폴더 · 이름 칸)
assert ts["findLabor"] == ["c1"] # 번호 칸도 찾음
@@ -91,14 +103,27 @@ def test_서버_목록_칸_수정일_labor(world):
doc = {
"일위대가번": "SU-000001",
"담은로직": [{"로직": "GF000219"}, {"로직": "GF000137"}],
"계산값": {"반영합": {"계": 12345.6}},
"단위": "개소",
"계산값": {"반영합": {"계": 12345.6}, "기준합": {"계": 2469.12}},
}
(root / "labor" / f"{ditch['열']}.json").write_text(json.dumps(doc), encoding="utf-8")
(root / "labor" / f"{wall['열']}.json").write_text("{깨짐", encoding="utf-8")
rows = {r["열"]: r for r in t.client.get(t.url).json()["items"]}
assert rows[ditch["열"]]["labor"] == {"번호": "SU-000001", "로직수": 2, "합계": 12345.6}
assert rows[ditch["열"]]["labor"] == {
"번호": "SU-000001",
"로직수": 2,
"합계": 12345.6,
"기준": 2469.12,
"단위": "개소",
}
assert "labor" in rows[ditch["열"]]["수정일"]
assert rows[wall["열"]]["labor"] == {"번호": None, "로직수": 0, "합계": None}
assert rows[wall["열"]]["labor"] == {
"번호": None,
"로직수": 0,
"합계": None,
"기준": None,
"단위": None,
}
doc["계산값"] = {"반영합": {"계": "글"}}
(root / "labor" / f"{ditch['열']}.json").write_text(json.dumps(doc), encoding="utf-8")
again = {r["열"]: r for r in t.client.get(t.url).json()["items"]}