diff --git a/B09_Estimation/B09_Estimation_BillOfQuantities_Rows.py b/B09_Estimation/B09_Estimation_BillOfQuantities_Rows.py index fc884869..33843c80 100644 --- a/B09_Estimation/B09_Estimation_BillOfQuantities_Rows.py +++ b/B09_Estimation/B09_Estimation_BillOfQuantities_Rows.py @@ -222,6 +222,10 @@ def _leaf_row( if children: names = ", ".join(f"{c[2:]} {unit_prices.book.title(c).name}" for c in children) row.note = f"이 공종엔 일위대가가 없고 한 층 아래에 있습니다 — 후보: {names}" + # 관경이 표 밖이면 **무엇을 정해야 하는지**까지 가리킨다. + diameter_note = pipe_diameter_note(node.code, item.variant_value) + if diameter_note: + row.note = f"{row.note} / {diameter_note}" reason = f"일위대가가 하위 공종에 있음(후보 {len(children)}건)" else: # ⚠ 「아직 안 만든 것」과 「성분이 빠져 못 세운 것」은 **할 일이 다르다**. @@ -362,7 +366,10 @@ def _leaf_row( _PENDING_FORMULA: dict[str, str] = {} -from B09_Estimation.B09_Estimation_KnownGaps import known_gap_note # noqa: E402 +from B09_Estimation.B09_Estimation_KnownGaps import ( # noqa: E402 + known_gap_note, + pipe_diameter_note, +) def pending_formula_note(code: str | None) -> str: diff --git a/B09_Estimation/B09_Estimation_KnownGaps.py b/B09_Estimation/B09_Estimation_KnownGaps.py index b0838fe9..ccf08ab5 100644 --- a/B09_Estimation/B09_Estimation_KnownGaps.py +++ b/B09_Estimation/B09_Estimation_KnownGaps.py @@ -67,3 +67,38 @@ def known_gap_note(code: str | None) -> str: if plain.startswith(prefix): parts.append(note) return " / ".join(parts) + + +#: 관부설 품셈 표가 다루는 관경 — 그 밖은 **표에 없는 것**이지 값이 틀린 것이 아니다. +PIPE_TABLE_DIAMETERS_MM = (800, 1000, 1200) + +#: 교본이 큰 관을 넘기는 자리 — **교본 기준이지 법령·행정규칙이 아니다.** +#: `횡단배수관_암거.md §5`(교본 3장) 「BOX암거 적용 — 수리계산상 배수관 **Ø1,500㎜ 이상** +#: 적용 유역 · 계곡 횡단경사 40% 이내 · 구체 수평 설치 원칙」. +#: ⚠ 그래서 「Ø1,500 이면 반드시 암거」라고 **단정하지 않는다** — 프로젝트 규칙이 +#: 「기본값은 현행 법령·행정규칙, 교본은 과거 참조」이기 때문이다. **가리키기만** 한다. +CULVERT_HINT_MM = 1500 + + +def pipe_diameter_note(code: str | None, variant_value: object) -> str: + """관경이 품셈 표 밖일 때 **어디를 봐야 하는지**를 가리킨다. + + ⚠ 「품셈 표에 그 관경이 없음」만 적으면 사용자가 **엉뚱한 것을 정하러 간다** — + 정할 것은 단가가 아니라 **시설 선택**일 수 있다. + """ + if not code or not str(code).startswith("FP-12-11"): + return "" + try: + diameter = int(float(str(variant_value))) + except (TypeError, ValueError): + return "" + if diameter in PIPE_TABLE_DIAMETERS_MM: + return "" + note = f"⚠ 품셈 관부설 표는 ∅800·∅1000·∅1200 까지만 있습니다 — Ø{diameter} 는 표 밖입니다." + if diameter >= CULVERT_HINT_MM: + note += ( + " ⓘ 임도기술교본 3장은 **Ø1,500㎜ 이상을 BOX암거 적용 유역**으로 봅니다" + "(`횡단배수관_암거 §5`). 관으로 놓을 자리가 아닐 수 있으니 **단가가 아니라" + " 시설 선택**을 먼저 볼 것. ⚠ 교본 기준이라 법령·행정규칙은 아닙니다." + ) + return note