wip(est-test): 개발 중 저장 — 전역 깃 싱크(요구 686-2) · tools/est-test · resources/tester

This commit is contained in:
2026-11-08 12:12:37 +09:00
parent 5e72aff136
commit 1beaefa529
48 changed files with 7159 additions and 316 deletions
+113 -10
View File
@@ -6,6 +6,18 @@ const EstForms = (() => {
columns: ["status", "Code", "Name", "originalGN", "GN", "originalTC", "TC", "difference"],
rows: EstStandard.changes(project),
};
if (id === "estimate-change")
return {
columns: ["status", "Code", "Name", "originalGN", "GN", "originalTC", "TC", "difference"],
rows: EstEstimate.changes(project),
};
if (id === "material-change" || id === "labor-change") {
const kindKey = id.startsWith("material") ? "material" : "labor";
return {
columns: ["status", "Code", "Name", "originalGN", "GN", "originalTC", "TC", "difference"],
rows: EstBasicPrices.changes(project, kindKey),
};
}
if (id === "standard-usage")
return {
columns: [
@@ -22,6 +34,61 @@ const EstForms = (() => {
],
rows: EstStandard.usage(project),
};
if (id === "estimate-usage")
return {
columns: [
"Code",
"Name",
"Size",
"Unite",
"GN",
"appliedPrice",
"sourcePrice",
"difference",
"TC",
"status",
],
rows: EstEstimate.usage(project),
};
if (id === "material-usage" || id === "labor-usage") {
const kindKey = id.startsWith("material") ? "material" : "labor";
return {
columns: [
"Code",
"Name",
"Size",
"Unite",
"GN",
"appliedPrice",
"sourcePrice",
"difference",
"TC",
"status",
],
rows: EstBasicPrices.usage(project, kindKey),
};
}
if (id === "machine-usage")
return {
columns: [
"Code",
"Name",
"Size",
"Unite",
"appliedPrice",
"originalPrice",
"difference",
"NC",
"GC",
"JC",
],
rows: EstMachine.usage(project),
};
if (id === "machine-change")
return {
columns: ["status", "Code", "Name", "Size", "Unite", "originalTC", "TC", "difference"],
rows: EstMachine.changes(project),
};
if (id === "change-costs")
return {
columns: ["Gubun", "Name", "originalCost", "changedCost", "difference"],
@@ -169,14 +236,36 @@ const EstForms = (() => {
22: "Wonga",
}[id];
if (table) {
const columns =
table === "Wonga"
? ["Gubun", "Name", "Youl", "VSusic", "Cost"]
: table === "CostMainDat"
? ["Code", "LineData"]
: table === "HeadMainDat"
? [...common, "GN", "NU", "GU", "JU", "SU", "TC"]
: [...common, "GN", "TU", "TC", "NC", "GC", "JC", "SC"];
let columns;
if (table === "Wonga") {
columns = ["Gubun", "Name", "Youl", "VSusic", "Cost"];
} else if (table === "CostMainDat") {
columns = ["Code", "LineData"];
} else if (table === "HeadMainDat") {
const gongMethod = Number(project.printSettings?.PrintGongMethod ?? 0);
if (id === 115 && gongMethod === 0) {
// 공람용: 수량만 인쇄
columns = [...common, "GN"];
} else if (id === 115 && gongMethod === 1) {
// 공람용: 단가만 인쇄
columns = [...common, "NU", "GU", "JU", "SU", "TC"];
} else {
// 기본(수량, 단가 인쇄)
columns = [...common, "GN", "NU", "GU", "JU", "SU", "TC"];
}
} else {
const gongMethod = Number(project.printSettings?.PrintGongMethod ?? 0);
if (id === 117 && gongMethod === 0) {
// 공람용: 수량만 인쇄
columns = [...common, "GN"];
} else if (id === 117 && gongMethod === 1) {
// 공람용: 단가/금액만 인쇄
columns = [...common, "TU", "TC", "NC", "GC", "JC", "SC"];
} else {
// 기본(수량, 단가/금액 인쇄)
columns = [...common, "GN", "TU", "TC", "NC", "GC", "JC", "SC"];
}
}
return { table, columns, rows: project.tables[table] || [] };
}
const totals = {
@@ -207,7 +296,15 @@ const EstForms = (() => {
.reduce((n, r) => n + EstMath.num(r[key]), 0);
return row;
});
return { table: totals, columns: [...common, "NC", "GC", "JC", "SC", "TC"], rows };
const gongMethod = Number(project.printSettings?.PrintGongMethod ?? 0);
let columns;
if ([116, 118].includes(id) && gongMethod === 0) {
// 공람용 총괄표: 금액 숨김
columns = [...common];
} else {
columns = [...common, "NC", "GC", "JC", "SC", "TC"];
}
return { table: totals, columns, rows };
}
if ([107, 108].includes(id))
return {
@@ -334,7 +431,13 @@ const EstForms = (() => {
};
const label = (key) => labels[key] || EstModel.labels[key] || key;
function grid(output) {
const { esc } = EstApp,
const esc = (v) =>
typeof EstApp !== "undefined"
? EstApp.esc(v)
: String(v ?? "")
.replaceAll("&", "&")
.replaceAll("<", "&lt;")
.replaceAll(">", "&gt;"),
number = (v) => new Intl.NumberFormat("ko-KR", { maximumFractionDigits: 12 }).format(v);
return `<table><thead><tr>${output.columns.map((key) => `<th>${esc(labels[key] || EstModel.labels[key] || key)}</th>`).join("")}</tr></thead><tbody>${output.rows.map((row) => `<tr>${output.columns.map((key) => `<td class="${typeof row[key] === "number" ? "numeric" : ""}">${esc(typeof row[key] === "number" ? number(row[key]) : key === "LineData" ? EstText.clean(row[key] || "") : (row[key] ?? ""))}</td>`).join("")}</tr>`).join("")}</tbody></table>`;
}