fix(b09): 내역서·단가산출서도 프로젝트가 고른 단가표로 — 구조물도 미리보기와 한 벌

- 내역서 창구가 기본값 cached_build() 대신 _build_for(프로젝트) 를 씀 — 계수를 고른 프로젝트에서 화면과 내역이 갈리던 자리
- 단가산출서 한 장 창구도 같은 단가표

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq
This commit is contained in:
2026-09-13 22:45:45 +09:00
co-authored by Claude Opus 5
parent e88877d81e
commit 7bf5cbd1d1
+5 -2
View File
@@ -755,8 +755,10 @@ async def get_bill(project_id: UUID) -> JSONResponse:
"""
from B08_Quantity.B08_Quantity_Router_Material import get_handoff, structure_bill_prices
build = cached_build()
try:
# ⚠ **그 프로젝트가 고른 값**으로 조립한 단가표 — 구조물도 미리보기(`_build_for`)와 한 벌.
# 기본값(`cached_build()`)을 쓰면 계수를 고른 프로젝트에서 화면과 내역이 갈림(브레인).
build = await _build_for(project_id)
response = await get_handoff(project_id)
payload = json.loads(bytes(response.body).decode("utf-8"))
except Exception:
@@ -811,7 +813,8 @@ 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)
# 내역서와 같은 단가표 — 번호·금액이 내역 줄과 갈리지 않게.
body = price_basis_detail(code, await _build_for(project_id))
except Exception:
logger.exception("B09 단가산출서 조회 실패: project_id=%s, code=%s", project_id, code)
return JSONResponse(