feat(b09): 준공 단계 — 계약금액 | 준공금액(기성 마지막 회차 누계를 옮기기만)

- 준공 별도 계산 규칙 미확인(35번 §3) — 규칙을 짓지 않고 기성 누계를 옮김 · 기성 한 장 불변
- 기성 회차가 없으면 준공금액 비움(0 원으로 안 채움)
- 기성 계산 조각(progress_for)을 떼어 준공이 같은 길로 받음
- 기성 간접재료비 확인 대기 닫음 — 예정가격작성기준 제17조·제39조② 근거(브레인 판정)
- 준공 탭 파일 · 사전 키(등록은 서브) · 시험 2건 · 전체 1730 통과

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
This commit is contained in:
2026-09-14 07:01:46 +09:00
co-authored by Claude Opus 5
parent 7d3b062c3e
commit a7a1b246b6
5 changed files with 280 additions and 7 deletions
+44 -2
View File
@@ -17,7 +17,8 @@
③ 제잡비 줄 = 간접노무비 ~ 부가세 직전(11번 §10) — 간접재료비·관급·분리발주 폐기물은 밖
원문 대조: 예정가격작성기준 제39조②(표준시장단가 장) 간접공사비 「1. 간접노무비」~「10.」 —
간접재료비 없음 · 제17조(원가계산 장)는 간접재료비를 재료비 안에 둠. 원가계산 장에는
「간접공사비」 묶음이 없어 기성 범위를 직접 정한 글은 아님.
「간접공사비」 묶음이 없어 기성 범위를 직접 정한 글은 아님 — 간접재료비 자리는 두 조문이
한 방향이라 ③ 확인 대기 닫음(2026-09-14 브레인 판정).
①′ 계약잡비율 직접입력(사유 필수)이 역산값을 이김 — 계약서에 제잡비율이 명시됨(브레인 판정).
④ 사정 — 「기성내역서(사정)」 열 이름뿐이라 칸만 받고 계산에 안 씀.
"""
@@ -403,7 +404,7 @@ def progress_sheet(
if cost_data.indirect_material_krw:
notes.append(
f"계약 간접재료비 {cost_data.indirect_material_krw:,.0f}원은 기성 제잡비 줄 밖"
"(원자료 「간접노무비부터 부가세 직전」) — 확인 대기"
"(예정가격작성기준 제17조 재료비 안 · 제39조② 간접공사비 목록 밖)"
)
unknown = sorted(set(overrides) - set(ratios))
if unknown:
@@ -419,3 +420,44 @@ def progress_sheet(
"vat": rounds[current - 1] if current else None,
"notes": notes,
}
def completion_sheet(progress: dict[str, Any]) -> dict[str, Any]:
"""준공 — 「계약금액 | 준공금액」 두 열(27번 §5 · 35번 §3 `준공조서(을/병)`).
⚠ 준공 별도 계산 규칙은 **미확인** — 지어내지 않고 기성 **마지막 회차 누계**를 옮기기만 함.
기성 한 장(`progress_sheet`, 마지막 회차)을 읽기만 하고 고치지 않음. 회차가 없으면 옮길
누계가 없어 준공금액을 비워 둠(0 원으로 안 채움).
"""
has_rounds = bool(progress.get("round"))
def moved(value: Any) -> str | None:
return value if has_rounds and value is not None else None
rows = [
{
**{key: row.get(key) for key in ("item_no", "name", "spec", "unit", "is_group")},
"contract_amount_krw": row.get("contract_amount_krw"),
"completion_amount_krw": moved(row.get("progress_cumulative_amount_krw")),
}
for row in progress["rows"]
if row.get("in_bill", True)
]
lines = [
{
"key": line["key"],
"name": line["name"],
"total": total,
"contract_krw": line["contract_krw"],
"completion_krw": moved(line.get("cumulative_krw")),
"completion_pct": line.get("cumulative_pct") if has_rounds else None,
}
for lines_of, total in ((progress["items"], False), (progress["summary"], True))
for line in lines_of
]
return {
"rows": rows,
"lines": lines,
"from_round": progress.get("round") or 0,
"notes": [] if has_rounds else ["기성 회차 없음 — 옮길 누계가 없어 준공금액 비움"],
}