From d75a57cc973d8c42a96aeb05eb437817324ff79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=9C=EC=9D=B8?= Date: Mon, 4 May 2026 14:32:15 +0900 Subject: [PATCH] Refine lifecycle detail modal totals and project detail popup layout --- PTC/management_dashboard_preview.html | 110 +++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 2 deletions(-) diff --git a/PTC/management_dashboard_preview.html b/PTC/management_dashboard_preview.html index 0007ca7..60e9aa5 100644 --- a/PTC/management_dashboard_preview.html +++ b/PTC/management_dashboard_preview.html @@ -1920,6 +1920,7 @@ const [companyAccountDetailModal, setCompanyAccountDetailModal] = useState(null); const [companyAccountDetailModalLoading, setCompanyAccountDetailModalLoading] = useState(false); const [lifecycleBreakdownModal, setLifecycleBreakdownModal] = useState(null); + const [lifecycleProjectTotalModal, setLifecycleProjectTotalModal] = useState(null); const [lifecycleAccountDetailModal, setLifecycleAccountDetailModal] = useState(null); const [lifecycleAccountDetailModalLoading, setLifecycleAccountDetailModalLoading] = useState(false); const [lifecycleAllocationModal, setLifecycleAllocationModal] = useState(null); @@ -5389,7 +5390,28 @@
-
프로젝트별 금액
+
+
프로젝트별 금액
+ +
연결된 프로젝트들 중 이 항목에 반영된 지출 금액입니다.
{(lifecycleBreakdownModal.projects || []).length ? ( @@ -6824,7 +6846,13 @@
지출 합계
-
{fmt(lifecycleAccountDetailModal.detail.summary.expense_supply_sum || 0)}원
+
+ {fmt( + Number(lifecycleAccountDetailModal.allocation_result_amount || 0) > 0 + ? Number(lifecycleAccountDetailModal.allocation_result_amount || 0) + : Number(lifecycleAccountDetailModal.detail.summary.expense_supply_sum || 0) + )}원 +
거래 건수
@@ -7000,6 +7028,84 @@
)} + {lifecycleProjectTotalModal && ( +
setLifecycleProjectTotalModal(null)}> +
e.stopPropagation()} + style={{ width: "min(980px, calc(100vw - 32px))", maxHeight: "min(760px, calc(100vh - 32px))", overflow: "auto" }} + > +
+
+
{lifecycleProjectTotalModal.label || "전체"} 프로젝트별 상세
+
연결 프로젝트 기준 전체 금액 내역입니다.
+
+ +
+
+
합계 금액
+
{fmt(lifecycleProjectTotalModal.total_amount || 0)}원
+
+
+
배부 계산식
+
본사관리비 배부원천 x (프로젝트 기준값 / 전체 기준값)
+
+ 기준값: {(lifecycleProjectTotalModal.allocation_mode || "") === "income_ratio" ? "프로젝트 입금 / 전체입금" : "프로젝트 지출 / 전체지출"} +
+
+ {(Array.isArray(lifecycleProjectTotalModal.allocation_details) && lifecycleProjectTotalModal.allocation_details.length + ? lifecycleProjectTotalModal.allocation_details + : [] + ).map((row, idx) => { + const sourceAmount = Number(row.source_amount || 0); + const allocatedAmount = Number(row.allocated_amount || 0); + const projectBasisAmount = Number(row.display_project_basis_amount ?? row.project_basis_amount ?? 0); + const totalBasisAmount = Number(row.display_total_basis_amount ?? row.total_basis_amount ?? 0); + return ( +
+ {((row.year_month || "").slice(0, 4) || "-")}년 · {fmt(sourceAmount)}원 x ({fmt(projectBasisAmount)}원 / {fmt(totalBasisAmount)}원) = {fmt(allocatedAmount)}원 +
+ ); + })} + {!((lifecycleProjectTotalModal.allocation_details || []).length) && ( +
표시할 배부 계산식이 없습니다.
+ )} +
+
+
+ {(lifecycleProjectTotalModal.projects || []).length ? ( + (lifecycleProjectTotalModal.projects || []).map((item) => ( +
+
+
{item.project_name || "(이름없음)"}
+
+ {item.project_code || "-"} · {item.project_type || "미지정"} · {item.construction_family || "종류미지정"} · {item.construction_method || "공법미지정"} +
+
+
{fmt(item.expense_supply || 0)}원
+
+ )) + ) : ( +
표시할 프로젝트가 없습니다.
+ )} +
+
+
+ )} + {lifecycleAllocationModal && (
setLifecycleAllocationModal(null)}>
e.stopPropagation()} style={{ width: "min(560px, calc(100vw - 24px))" }}>