fix(b09): 경비수량금액집계표 빈 까닭 표 위 안내 — 경비 갈래 자원 없음(166-5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018jonfdxn1Xit9bdkNJpE4G
This commit is contained in:
2026-10-10 00:04:49 +09:00
co-authored by Claude Opus 5.5
parent 35d6b68c41
commit 4e382a703b
2 changed files with 32 additions and 4 deletions
@@ -4,6 +4,7 @@
*
* 값 = 서버 단독 역전개(`B09_Estimation_Summary` · GET 응답 `summary`) — 조작 중엔 안 바뀜 · [저장] 뒤 정본
* 끝수 = 총수량 ROUND 2 · 금액 ROUND(수량 × 단가, 0) · 줄 누름 = 단가를 낸 목록표 줄
* 경비 집계표 빈 까닭(166-5) = 산근 · 대가 어느 길도 경비 자원 줄을 안 냄(기계 → 중기 · 구역화물 → 자재)
* ========================================================================== */
import type { DataRow } from "@ui/ui_template_data_table";
@@ -26,7 +27,10 @@ const hint = (payload: Row, extra = ""): string => {
return `${HINT}${extra}${n ? ` · 연결 없음 ${n} — 전개 안 함(연결 점검 탭)` : ""}`;
};
function resourceTab(id: string, list: TabId, unitPrice: string): TabBuild {
/** 줄이 없을 때 표 위 맨 앞 안내 */
const EXPENSE_NONE = "경비 갈래 자원 없음 — 중기 · 자재로 셈 · 경비 로직이 들어오면 채워짐";
function resourceTab(id: string, list: TabId, unitPrice: string, none = ""): TabBuild {
return ({ payload }): TabTable => {
const rows: DataRow[] = ((payload.summary || {})[id] || []).map((r: Row) => ({ ...r }));
const sum = rows.reduce((acc, r) => acc + (typeof r.amount === "number" ? r.amount : 0), 0);
@@ -44,7 +48,7 @@ function resourceTab(id: string, list: TabId, unitPrice: string): TabBuild {
rows,
total: rows.length ? { name: "계", amount: sum } : null,
frozen: 2,
hint: hint(payload),
hint: !rows.length && none ? `${none} · ${hint(payload)}` : hint(payload),
link: (i) => (rows[i] ? { tab: list, key: String(rows[i].key) } : null),
};
};
@@ -52,7 +56,7 @@ function resourceTab(id: string, list: TabId, unitPrice: string): TabBuild {
export const buildSumMaterial = resourceTab("sum_material", "material", "단가");
export const buildSumLabor = resourceTab("sum_labor", "labor", "단가");
export const buildSumExpense = resourceTab("sum_expense", "expense", "단가");
export const buildSumExpense = resourceTab("sum_expense", "expense", "단가", EXPENSE_NONE);
export const buildSumMachine: TabBuild = ({ payload }): TabTable => {
const rows: DataRow[] = ((payload.summary || {}).sum_machine || []).map((r: Row) => ({ ...r }));