Merge remote-tracking branch 'origin/sub_laptop_3' into sub_laptop_6
# Conflicts: # B09_Estimation/B09_Estimation_Router.py # B09_Estimation/B09_Estimation_UI_Shell.ts
This commit is contained in:
@@ -53,6 +53,7 @@ import {
|
||||
buildSumMaterial,
|
||||
} from "./B09_Estimation_UI_Tabs_Summary";
|
||||
import { buildCost, buildTotal } from "./B09_Estimation_UI_Tabs_Total";
|
||||
import { buildSg, buildSgList } from "./B09_Estimation_UI_Tabs_Sangeun";
|
||||
|
||||
function L(key: keyof typeof ui_locales): string {
|
||||
return ui_locales[key][currentLanguageIndex];
|
||||
@@ -61,8 +62,6 @@ function L(key: keyof typeof ui_locales): string {
|
||||
const LATER: Record<string, string> = {
|
||||
dg_list: "일위대가목록표 — 145-2(다른 창)가 들어오면 생김",
|
||||
dg: "일위대가표 — 145-2(다른 창)가 들어오면 생김",
|
||||
sg_list: "단가산출근거목록표 — 145-1(다른 창)가 들어오면 생김",
|
||||
sg: "단가산출근거 — 145-1(다른 창)가 들어오면 생김",
|
||||
};
|
||||
|
||||
const BUILDERS: Partial<Record<TabId, TabBuild>> = {
|
||||
@@ -81,6 +80,8 @@ const BUILDERS: Partial<Record<TabId, TabBuild>> = {
|
||||
sum_labor: buildSumLabor,
|
||||
sum_expense: buildSumExpense,
|
||||
sum_machine: buildSumMachine,
|
||||
sg_list: buildSgList,
|
||||
sg: buildSg,
|
||||
};
|
||||
|
||||
async function request<T>(path: string, init: RequestInit = {}): Promise<T> {
|
||||
@@ -104,11 +105,21 @@ function note(textValue: string): HTMLElement {
|
||||
return p;
|
||||
}
|
||||
|
||||
/** 브라우저 셈 — 서버 짝과 같은 식(조작 중) */
|
||||
/** 산근(145-1) = 서버 단독 — 받은 그대로 두는 칸 */
|
||||
const SERVER_ONLY = ["sg", "sg_list", "sg_gaps", "sg_notes"] as const;
|
||||
|
||||
/** 브라우저 셈 — 서버 짝과 같은 식(조작 중) · 산근은 서버 답 그대로(+ 「연결 없음」) */
|
||||
export function computeSheets(payload: Row, user: Row): Row {
|
||||
const sheets = computeEstimation(payload.inputs, user);
|
||||
// 145-4 총괄 · 원가계산서 = 설계내역서 비목 합(145-3 `bill.sums`) + 사용자 요율 · 손입력
|
||||
return { ...sheets, total: computeTotal(sheets.bill?.sums, user.estimate) };
|
||||
const base = computeEstimation(payload.inputs, user);
|
||||
const server: Row = payload.sheets || {};
|
||||
const kept = Object.fromEntries(SERVER_ONLY.map((k) => [k, server[k] ?? []]));
|
||||
return {
|
||||
...base,
|
||||
...kept,
|
||||
gaps: [...base.gaps, ...(server.sg_gaps || [])],
|
||||
// 145-4 총괄 · 원가계산서 = 설계내역서 비목 합(145-3 `bill.sums`) + 사용자 요율 · 손입력
|
||||
total: computeTotal(base.bill?.sums, user.estimate),
|
||||
};
|
||||
}
|
||||
|
||||
export function renderB09Estimation(root: HTMLElement): void {
|
||||
|
||||
Reference in New Issue
Block a user