diff --git a/B08_Quantity/B08_Quantity_Engine_Handoff_Rows.py b/B08_Quantity/B08_Quantity_Engine_Handoff_Rows.py index eaa403f0..c12f967f 100644 --- a/B08_Quantity/B08_Quantity_Engine_Handoff_Rows.py +++ b/B08_Quantity/B08_Quantity_Engine_Handoff_Rows.py @@ -408,6 +408,19 @@ def _structure_rows( bill_quantity = float(structure.get("billing_quantity") or 0.0) else: bill_unit, bill_quantity = "m", length + # ⚠⚠ **물량 0 을 내역에 세우지 않는다**(2026-09-09 감사). 물넘이포장이 면적을 안 받아 + # `0.0 ㎡` 로 서고 있었다 — 코드가 붙어 있어 **0 원 줄**이 만들어지고, 화면에는 + # 「값이 있는 줄」로 보인다. 0 은 「없음」과 구별이 안 된다(오늘 표토에서 겪은 자리). + # ⇒ 줄은 그대로 넘기되 **내역에서 빼고 까닭을 적는다.** + in_bill = bill_quantity > 0 + zero_reason = "" + if not in_bill: + notes = "; ".join(str(note) for note in (structure.get("notes") or [])) + zero_reason = ( + f"물량이 0 이라 내역에 안 세움 — {notes}" + if notes + else "물량이 0 이라 내역에 안 세움 — 저장 제원에서 치수·면적을 넣으면 값이 섭니다" + ) rows.append( { "work_item_code": code, @@ -431,8 +444,8 @@ def _structure_rows( # 철근이 있나 없나로 자동 판정 — 사람이 고르는 값이 아니다. "structure_kind": kind, # ⚠ 줄마다 **왜 막혔는지**를 싣는다 — 안 실으면 받는 쪽 화면이 빈다. - "blocked_kind": blocked_kind, - "blocked_reason": blocked_reason, + "blocked_kind": blocked_kind or (BLOCKED_INPUT_MISSING if not in_bill else None), + "blocked_reason": blocked_reason or zero_reason, # 규격 갈래(뒷길이 …㎝ 이하) — 못 고르면 사유가 남는다. # ⚠ **갈래 키 문자열을 우리가 조립하지 않는다** (2026-09-07 계약 변경). # 품셈 원문이 물결표를 섞어 쓴다(`∼` U+223C / `~` U+FF5E). 두 창이 각자 @@ -447,8 +460,8 @@ def _structure_rows( "spec_class_basis": class_basis, # ⚠ 물량을 못 채운 조각 — 0 으로 적지 않고 사유와 함께 드러낸다. "composite_not_ready": parts_missing or None, - "in_bill": True, - "in_bill_reason": (composite or {}).get("why", ""), + "in_bill": in_bill, + "in_bill_reason": zero_reason or (composite or {}).get("why", ""), "origin": ORIGIN_STRUCTURE, } )