feat(B09): ③ 단가산출서(D층) 신설 — 내역 줄에서 검산 경로가 이어짐
실무 내역서는 줄마다 비고에 「단산 46 참조」를 적고 그 산출서를 펴서 검산함(8-13).
STC 실측도 `D` 가 `B`(일위대가)를 참조하는 한 층 위였음(9-3)
- `PriceBook` 의 「제목 + 상세」 한 쌍에 `kind=PRICE_BASIS` 만 얹음 —
표를 세 벌 만들지 않음. 화면도 일위대가 탭과 **같은 2단 모양**
- 번호는 **코드에 안 박음** — 실무 참조번호는 그 내역서 안의 차례라
프로젝트마다 다름. 코드는 공종을 가리키고 번호는 조판할 때 매김
- 같은 일위대가가 두 줄에 쓰이면 **산출서는 한 장**, 두 줄이 같은 번호를 가리킴
- 내역 줄 비고에 「단산 N 참조」를 달음
- 지금은 일위대가를 그대로 한 줄로 참조 — 할증·기타 비용이 붙을 자리를 미리 열어 둠
- `GET …/estimation/price-basis/{code}` 로 본표 조회
화면 실측: 내역 줄 「2-2-1 측구터파기 488,926 / 단산 1 참조」,
산출서 탭에 1장(토사 FP-09-12-01 ㎥ 5,288.6), 눌러 본표·참조 코드 확인
검증: pytest 195 통과, tsc 0건
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -296,5 +296,22 @@ async def get_bill(project_id: UUID) -> JSONResponse:
|
||||
"excluded": [row.as_dict() for row in result.excluded],
|
||||
"materials": [row.as_dict() for row in result.material_rows],
|
||||
"summary": bill_summary(result),
|
||||
"price_basis": result.price_basis.as_dict() if result.price_basis else {"entries": []},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@router.get("/{project_id}/estimation/price-basis/{code}")
|
||||
async def get_price_basis_detail(project_id: UUID, code: str) -> JSONResponse:
|
||||
"""③ 단가산출서 한 장 — 그 단가가 무엇을 참조해 나왔는지."""
|
||||
from B09_Estimation.B09_Estimation_PriceBasis import price_basis_detail
|
||||
|
||||
try:
|
||||
body = price_basis_detail(code)
|
||||
except Exception:
|
||||
logger.exception("B09 단가산출서 조회 실패: project_id=%s, code=%s", project_id, code)
|
||||
return JSONResponse(
|
||||
status_code=404,
|
||||
content={"status": "error", "message": "그 단가산출서를 찾지 못했습니다."},
|
||||
)
|
||||
return JSONResponse(content={"status": "success", **body})
|
||||
|
||||
Reference in New Issue
Block a user