fix: hide zero shared allocation row in construction breakdown

This commit is contained in:
2026-05-07 08:54:43 +09:00
parent 930dc2d1de
commit b10063a93f

View File

@@ -5445,11 +5445,13 @@
const sharedAllocationDetails = Object.values(aggregatedByYearMonth).sort((a, b) => const sharedAllocationDetails = Object.values(aggregatedByYearMonth).sort((a, b) =>
String(a.year_month || "").localeCompare(String(b.year_month || "")) String(a.year_month || "").localeCompare(String(b.year_month || ""))
); );
const shouldShowSharedRow =
lifecycleBreakdownModal.label !== "시공비" || sharedAmount > 0;
const groupedRows = [ 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: 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: 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); ].filter((row) => row.showWhenZero || row.amount > 0);
return groupedRows.map((item) => ( return groupedRows.map((item) => (
<button <button