feat(est): link quantity to individual rows
This commit is contained in:
@@ -96,11 +96,19 @@ const EstForms = (() => {
|
||||
};
|
||||
}
|
||||
if (id === 14) {
|
||||
const target = (item) => {
|
||||
if (!item.TargetKey) return item.TargetCode ?? item.LinkCode ?? "";
|
||||
const row = project.tables.EstMainDat.find(
|
||||
(entry) => entry.PkID != null && `id:${entry.PkID}` === item.TargetKey,
|
||||
);
|
||||
return row ? `${row.Name || "내역"} (${row.Code || item.TargetKey})` : item.TargetKey;
|
||||
};
|
||||
const manual = EstQuantity.manual(project.quantities || []),
|
||||
rows = manual.rows.map((row) => ({
|
||||
...row,
|
||||
SheetName: "수식표",
|
||||
formula: row.formula || "",
|
||||
TargetCode: target(row),
|
||||
})),
|
||||
errors = [...manual.errors];
|
||||
for (const sheet of project.quantitySheets || []) {
|
||||
@@ -112,7 +120,7 @@ const EstForms = (() => {
|
||||
...item,
|
||||
SheetName: sheet.Name || sheet.Code,
|
||||
formula: index < 0 ? "" : EstText.clean(calculated.rows[index].LineData),
|
||||
TargetCode: item.TargetCode ?? item.LinkCode ?? "",
|
||||
TargetCode: target(item),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user