fix(b09): 경비수량금액집계표 빈 까닭 표 위 안내 — 경비 갈래 자원 없음(166-5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018jonfdxn1Xit9bdkNJpE4G
This commit is contained in:
2026-10-10 00:04:49 +09:00
co-authored by Claude Opus 5.5
parent 35d6b68c41
commit 4e382a703b
2 changed files with 32 additions and 4 deletions
+25 -1
View File
@@ -8,6 +8,7 @@
"""
import asyncio
import json
import sys
from pathlib import Path
@@ -54,7 +55,7 @@ LINES = {
{"kind": "machine", "key": "X1", "qty": 4.295},
{"kind": "hopyo", "key": "B", "qty": 0.5},
{"kind": "material", "key": "M4", "qty": 0.354},
{"kind": "expense", "key": "E16", "qty": 1.103},
{"kind": "expense", "key": "E16", "qty": 1.103}, # 합성 줄 — 산근 · 대가는 경비 줄을 안 냄(166-5)
]},
"B": {"lines": [{"kind": "labor", "key": "L1", "qty": 1.658},
{"kind": "labor", "key": "L9", "qty": 1}]},
@@ -155,3 +156,26 @@ def test_산근_블록_역전개_엑셀_반올림():
machine = s["sum_machine"][0] # 중기시간금액집계표 10 줄 노무비
assert (machine["qty"], machine["labor"], machine["sum"]) == (1436.14, 79992998, None)
assert s["unlinked"] == 3 # 토공 · 대가 전 구조물 · 수량 빈칸 = 전개 안 함
# ── 166-5 경비 집계표 — 실제 블록 꼴은 경비 자원 0 → 표 위 안내 ──
from test_155_b09_tabs import _node # noqa: E402
EXPENSE_NONE = "경비 갈래 자원 없음 — 중기 · 자재로 셈 · 경비 로직이 들어오면 채워짐"
def _expense_tab(summary):
return _node(
f"\nconst t = buildSumExpense({{ payload: {{ summary: {json.dumps(summary)} }} }});"
"\nconsole.log(JSON.stringify({ n: t.rows.length, hint: t.hint }));",
"UI_Tabs_Summary",
)
def test_166_5_실자료_경비_0_이면_안내():
s = compute_summary(SG_SHEETS, hopyo_lines(SG_SHEETS))
assert s["sum_expense"] == [] # 산근 블록 꼴 = 경비 갈래 줄 없음
out = _expense_tab(s)
assert out["n"] == 0 and out["hint"].startswith(EXPENSE_NONE)
filled = _expense_tab(compute_summary(SHEETS, LINES)) # 합성 경비 줄이 있으면 안내 없음
assert filled["n"] == 1 and EXPENSE_NONE not in filled["hint"]