merge: origin/sub_laptop_1 받기 — 노임 준용 + 품셈재료 연결 양쪽 살림
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WRFJmmhPi4exAzHgPZHMT
This commit is contained in:
@@ -192,20 +192,23 @@ def _brief(ref: str, row: dict) -> dict:
|
||||
|
||||
|
||||
def _prices(whole, row: dict) -> dict:
|
||||
"""호표 요소 → 요소 줄 요약(단가 자동 칸) · `{이름}` 낀 열쇠·하위 로직은 계산 때 정해짐."""
|
||||
"""호표 요소 → 요소 줄 요약(단가 자동 칸) · `{이름}` 낀 열쇠·하위 로직은 계산 때 정해짐.
|
||||
품셈재료는 연결을 따라간 낮은 값과 출처 · 자재지역 후보는 계산 때 정해짐(값 None)."""
|
||||
out = {}
|
||||
for item in row.get("호표") or []:
|
||||
ref = str(item.get("요소", ""))
|
||||
if item.get("종류") != "로직" and "{" not in ref:
|
||||
try:
|
||||
node = cm.mf.parse(ref)
|
||||
if node[0] == "field": # 값 묶음 요소의 칸 — 단가는 그 칸
|
||||
row = whole.get(node[1][1])
|
||||
out[ref] = {**_brief(ref, row), "값": row["값"][node[2]]}
|
||||
else:
|
||||
out[ref] = _brief(ref, whole.get(ref))
|
||||
except (cm.mf.FormulaError, KeyError, TypeError):
|
||||
out[ref] = _brief(ref, whole.get(ref))
|
||||
except cm.mf.FormulaError:
|
||||
out[ref] = None
|
||||
continue
|
||||
if ref.startswith(cm.mf.LINKED):
|
||||
try:
|
||||
value, source = cm.mf.element(whole, ref, {})
|
||||
except (cm.mf.FormulaError, KeyError, TypeError):
|
||||
value, source = None, None
|
||||
out[ref].update({"값": value, "출처": source})
|
||||
return out
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user