auto: 2026-09-09 19:43 (EOMSANGDON-HOME)

This commit is contained in:
2026-09-09 19:43:12 +09:00
parent db38e75724
commit 5bf4ff8d1f
4 changed files with 62 additions and 1 deletions
@@ -315,6 +315,29 @@ def load_operator_wages(labor_file: str = "labor_const_2026-01-01.json") -> dict
}
#: 노임 신뢰도 기호 — 원문 「임금적용요령」이 직종 옆에 붙여 둔 표시.
#: `*` 조사현장 5개 미만 (적용 시 유의)
#: `**` 미조사 — 유사 직종 단가에 준하여 적용(재경원 회계 45101-45)
#: ⚠ **값이 없는 것과 다르다** — 단가는 서 있되 **표본이 얇다**는 뜻이라 막지 않고 알린다.
#: 지식DB `노임단가_적용 §2-3` 이 「프로그램에서 단가 채택 시 플래그 유지 필요」로 두었고,
#: `원가_입력변수_사전` 도 「해당 단가 사용 시 경고 표시」라 적었는데 노임 층에 없었다
#: (2026-09-09에 이음).
LABOR_RELIABILITY_LABEL = {
"*": "조사현장 5개 미만 — 표본이 얇습니다",
"**": "미조사 직종 — 유사 직종 단가에 준해 적용(재경원 회계 45101-45)",
}
def load_labor_reliability(labor_file: str = "labor_const_2026-01-01.json") -> dict[str, str]:
"""직종코드 → 신뢰도 기호(`*`·`**`). 정상 공표 직종은 아예 안 담는다."""
records = _read_json(*_CATALOG_SUBPATH, labor_file)["variables"]["labor_rate"]["records"]
return {
str(r["occupation_code"]): str(r["reliability"])
for r in records
if str(r.get("reliability") or "").strip()
}
def hourly_cost_of(machine_code: str, *, region: str | None = None):
"""기종 하나의 **시간당 사용료 3분할**을 완성해 돌려준다.
@@ -101,6 +101,9 @@ class PriceTitle:
slot_pages: list[str | None] = field(default_factory=lambda: [None] * PRICE_SLOT_COUNT)
#: 채택 슬롯(1-based).
adopted_slot: int = DEFAULT_ADOPTED_SLOT
#: 노임 신뢰도 기호(`*`·`**`) — 노임 줄에만 붙는다. 빈 문자열이면 정상 공표 직종.
#: ⚠ **금액을 바꾸지 않는다.** 값은 그대로 쓰고 「표본이 얇다」는 사실만 나른다.
reliability: str = ""
def adopted_price(self) -> Decimal:
"""채택 슬롯의 단가. 비어 있으면 0 으로 때우지 않고 멈춘다."""
@@ -43,6 +43,8 @@ from B09_Estimation.B09_Estimation_MachineProductivity_Dozer import (
from B09_Estimation.B09_Estimation_MachineOperating import (
load_fuel_price,
load_operating_records,
LABOR_RELIABILITY_LABEL,
load_labor_reliability,
load_operator_wages,
)
from B09_Estimation.B09_Estimation_PriceBook import (
@@ -116,10 +118,17 @@ class UnitPriceBuild:
basis_missing: dict[str, str] = field(default_factory=dict)
#: 계수를 못 세운 표 — **무엇이 없는지**를 들고 있는다.
factor_gaps: dict[str, FactorGap] = field(default_factory=dict)
#: 내역에 실린 노임 중 **신뢰도 기호가 붙은 것** — 직종코드 → (이름, 기호, 뜻).
#: ⚠ 금액을 막지 않는다. 「표본이 얇다」는 사실을 화면이 말하게 하는 통로다
#: (지식DB `노임단가_적용 §2-3` 「단가 채택 시 플래그 유지 필요」, 2026-09-09에 이음).
labor_reliability: dict[str, tuple[str, str, str]] = field(default_factory=dict)
def _add_labor_titles(book: PriceBook, wages: dict[str, Decimal]) -> None:
catalog = load_labor_catalog()
# ⚠ 신뢰도 기호(`*`·`**`)를 제목에 함께 싣는다 — 지식DB 가 「단가 채택 시 플래그 유지」로
# 두었는데 노임 층에 없었다(2026-09-09). 금액은 안 바꾸고 **사실만** 나른다.
reliability = load_labor_reliability()
for entry in catalog.entries:
wage = wages.get(entry.code)
if wage is None or entry.code in book.titles:
@@ -131,6 +140,7 @@ def _add_labor_titles(book: PriceBook, wages: dict[str, Decimal]) -> None:
name=entry.name,
unit="",
slots=_slots(wage),
reliability=reliability.get(entry.code, ""),
)
)
@@ -322,6 +332,8 @@ def _add_machine_layers(book: PriceBook, machine_codes: set[str]) -> list[str]:
name="조종원",
unit="",
slots=_slots(wages[wage_code]),
# ⚠ 조종원도 노임이다 — 같은 플래그가 붙어야 한다.
reliability=load_labor_reliability().get(wage_code, ""),
)
)
# 조합 층에도 조종원을 같이 단다 — 본체를 모는 사람은 하나뿐이다.
@@ -757,9 +769,32 @@ def build_unit_prices(
build.combined_swapped = _apply_combined_misc_rate(
build.book, [code for code in build.book.titles if code.startswith("B-")]
)
build.labor_reliability = _labor_reliability_in_use(build.book)
return build
def _labor_reliability_in_use(book: PriceBook) -> dict[str, tuple[str, str, str]]:
"""**실제로 일위대가에 붙은** 노임 중 신뢰도 기호가 있는 것만 모은다.
⚠ 카탈로그 전체(40직종)를 경고하면 **쓰지도 않는 직종까지** 화면을 채운다 —
「이 내역서에 실린 단가 중 표본이 얇은 것」만 말해야 사용자가 볼 값어치가 있다.
⚠ 값을 바꾸지 않는다. 지식DB `노임단가_적용 §2-3`·`원가_입력변수_사전` 이
「단가 채택 시 플래그 유지 · 경고 표시」로 둔 자리를 잇는 것뿐이다(2026-09-09).
"""
used = {row.ref_code for rows in book.details.values() for row in rows}
found: dict[str, tuple[str, str, str]] = {}
for code in sorted(used):
title = book.titles.get(code)
if title is None or title.kind is not PriceKind.LABOR or not title.reliability:
continue
found[code] = (
title.name,
title.reliability,
LABOR_RELIABILITY_LABEL.get(title.reliability, "신뢰도 기호가 붙은 직종"),
)
return found
def _has_full_formula(
master: dict,
work_item_code: str,