feat(M01): /calc 재료 줄마다 품목 칸(키·이름·규격·단위·값칸) 더함 (PLAN 8-5)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgUhN55Z3BCYhUJTjwTNfj
This commit is contained in:
2026-09-24 22:04:30 +09:00
co-authored by Claude Sonnet 5
parent 3f7d2b386f
commit 2e9d457f94
3 changed files with 40 additions and 4 deletions
+21 -1
View File
@@ -129,7 +129,27 @@ def pick(master, cond: dict, env: dict, unit: str | None = None) -> str:
def priced(master, item: dict, ref, env: dict, index: int | None):
"""재료 줄 단가 — (단가, 출처, 까닭, 단위경고). 고른 품목(`고름`)이 있으면 그것 · 검색어가 있으면 찾기 ·
없으면 옛 길. 자재 단가는 줄 단위로 환산 · 성격이 다르면 그대로 두고 경고."""
없으면 옛 길. 자재 단가는 줄 단위로 환산 · 성격이 다르면 그대로 두고 경고.
넷째 = 줄에 덧붙일 칸 — `단위경고` · `품목`(잡힌 품목 키 · 이름 · 규격 · 단위 · 값 칸)."""
price, source, why, warn = _priced(master, item, ref, env, index)
extra = {"단위경고": warn} if warn else {}
key, _, slot = (source or "").partition(".")
try:
row = master.get(key) if key else None
except mm.mf.FormulaError:
row = None
if row:
extra["품목"] = {
"키": key,
"이름": row.get("이름"),
"규격": row.get("규격"),
"단위": row.get("단위"),
"값칸": slot,
}
return price, source, why, extra
def _priced(master, item: dict, ref, env: dict, index: int | None):
unit = item.get("단위")
picked = (CHOSEN.get() or {}).get(str(index)) if index is not None else None
try: