fix(est): block missing quantity markers

This commit is contained in:
2026-11-07 08:14:32 +09:00
parent ab5a07ff34
commit 1d02b0205a
3 changed files with 30 additions and 1 deletions
+2
View File
@@ -34,6 +34,8 @@ Ctrl+S는 입력 중인 셀도 확정한 뒤 저장합니다. 연속 저장 요
수량산출서 인쇄 서식에는 직접 작성한 수식표와 산출서의 산식, 계산 수량, 연결 내역이 함께 표시됩니다. 계산할 수 없는 수식은 오류를 표시합니다.
산출 행의 결과 표지 개수가 연결 정보와 다르면 계산 오류로 표시하며, 기존 저장 수량을 내역에 반영하지 않습니다. 화면이나 Excel에서 수식을 수정할 때 결과 표지와 연결 항목을 유지하세요.
## 검증과 남은 범위
기계 성분·합계 48건, 일위 41건, 내역 37건, 산출 결과 118건과 호표 8건, 원가 수식 23건을 대조합니다. 원가 도급액 고정 반복 차이 `324 → -32 → 3 → 0`을 재현합니다. 단가 갱신 후 전체 재계산과 반복 계산의 안정성도 시험합니다.
+7 -1
View File
@@ -56,6 +56,12 @@ const EstQuantity = (() => {
return { Code: code, Name: name, rows, items, options };
}
function calculate(sheet) {
const markerErrors = sheet.rows.flatMap((row, index) => {
const count = [...String(row.LineData || "").matchAll(/\x12([-\d.,]+)\x12/g)].length;
return count === (row.markers || []).length
? []
: [`${index + 1}행: 결과 표지 수가 다릅니다.`];
});
const input = [
{ Index: 1, Code: sheet.Code, LineData: "" },
...sheet.rows.map((row) => {
@@ -110,7 +116,7 @@ const EstQuantity = (() => {
rows: result.rows.slice(1),
items: sheet.items.map((item) => ({ ...item, GN: values.get(item.Code) ?? item.GN })),
checks,
errors: result.errors,
errors: [...result.errors, ...markerErrors],
};
}
function manual(items) {