fix(est): block missing quantity markers
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user