fix: hide zero shared allocation row in construction breakdown
This commit is contained in:
@@ -5445,11 +5445,13 @@
|
||||
const sharedAllocationDetails = Object.values(aggregatedByYearMonth).sort((a, b) =>
|
||||
String(a.year_month || "").localeCompare(String(b.year_month || ""))
|
||||
);
|
||||
const shouldShowSharedRow =
|
||||
lifecycleBreakdownModal.label !== "시공비" || sharedAmount > 0;
|
||||
const groupedRows = [
|
||||
{ key: "영업", label: "영업", amount: roleAmount.영업, showWhenZero: false, codes: Array.from(roleCodes.영업) },
|
||||
{ key: "설계", label: "설계", amount: roleAmount.설계, showWhenZero: false, codes: Array.from(roleCodes.설계) },
|
||||
{ key: "시공", label: "시공", amount: roleAmount.시공, showWhenZero: true, codes: Array.from(roleCodes.시공) },
|
||||
{ key: "공통배분분", label: "공통배분분", amount: sharedAmount, showWhenZero: true, codes: [] },
|
||||
{ key: "공통배분분", label: "공통배분분", amount: sharedAmount, showWhenZero: shouldShowSharedRow, codes: [] },
|
||||
].filter((row) => row.showWhenZero || row.amount > 0);
|
||||
return groupedRows.map((item) => (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user