feat(B09): 공구손료·잡재료 칸 — 기본은 빔, 넣으면 주재료비의 %로 붙음

사용자 확정 5차 작은 것 1 「지금은 안 넣되 숫자 넣으면 되게 열어 둘 것」.
근거는 산림품셈 1-2-6 — 주재료비(할증수량 제외)의 2~5%까지, 산정 근거 명시.

- 기초자료 탭 「산출 조건」에 칸 하나 + [적용]. 비면 줄 자체가 안 섬(지금 상태 그대로).
- 밑수는 **자재 줄만** — 노무·경비, 하위 일위대가 재료비는 안 듦(층마다 거듭 세지 않음).
- 상한 5% 초과는 거절(400) — 조용히 깎아 넣지 않음.
- ⚠ 지금은 일위대가에 주재료비가 선 공종이 0개라 붙을 밑수가 없음 — 그 사실을 칸 밑에 띄움.
- 곁다리: 비율 줄(제잡비·공구손료)이 저장했다 읽으면 사라지던 것을 고침.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-09 20:30:10 +09:00
co-authored by Claude Opus 5
parent 404ec16e65
commit 83c842e37a
8 changed files with 445 additions and 5 deletions
@@ -211,6 +211,37 @@ def detail_of(build: UnitPriceBuild, code: str) -> dict:
)
continue
if detail.percent_of_material is not None:
# 공구손료·잡재료 — 지금까지 쌓인 **주재료비**의 %가 재료비로 붙는다
# (산림품셈 1-2-6). 밑수는 **자재 줄만** — 하위 일위대가가 품고 온 재료비는
# 그쪽에서 이미 셌다(`PriceBook.resolve` 의 같은 자리와 한 규칙).
material_so_far = sum(
(
Decimal(str(row_item["material"]))
for row_item in rows
if row_item.get("kind") == PriceKind.MATERIAL.value
),
_ZERO,
)
amount = material_so_far * detail.percent_of_material / Decimal(100)
rows.append(
{
"code": detail.ref_code,
"name": "공구손료·잡재료",
"spec": f"주재료비의 {detail.percent_of_material}%",
"unit": "%",
"quantity": str(detail.percent_of_material),
"material": str(amount),
"labor": "0",
"expense": "0",
"total": _money_text(amount),
"source": "품셈 1-2-6",
"drillable": False,
"note": detail.note,
}
)
continue
child = build.book.title(detail.ref_code)
unit_money = build.book.resolve(detail.ref_code)
line = unit_money.scaled(detail.quantity)