wip(est-test): 개발 중 저장 3 — 깃 싱크(11-08)

This commit is contained in:
2026-11-08 17:44:13 +09:00
parent d39eece45e
commit db71cdbf7c
28 changed files with 1027 additions and 202 deletions
+4 -3
View File
@@ -233,7 +233,8 @@ const EstWonga = (() => {
}
// 1) 당초 보존값(VSusic_, Cost_, CalcIndex_)이 있는 경우 복원
for (const r of rows) {
const restored = structuredClone(rows);
for (const r of restored) {
if (r.VSusic_ !== undefined) {
r.VSusic = r.VSusic_;
}
@@ -247,14 +248,14 @@ const EstWonga = (() => {
// 2) TotalFix 옵션 해제 및 일반 재계산 수행
const newOptions = { ...options, TotalFix: false };
const calcResult = calculate(rows, newOptions, bases);
const calcResult = calculate(restored, newOptions, bases);
if (calcResult.errors && calcResult.errors.length) {
throw Error(`원가계산서 초기화 재계산 오류: ${calcResult.errors.join("; ")}`);
}
for (let i = 0; i < rows.length; i++) {
if (calcResult.rows[i]) {
rows[i].Cost = calcResult.rows[i].Cost;
Object.assign(rows[i], calcResult.rows[i]);
}
}