fix: hide project and transaction sections for shared allocation account modal

This commit is contained in:
2026-05-04 17:41:28 +09:00
parent 588d787d02
commit d7a322a6ca

View File

@@ -7052,76 +7052,80 @@
</section>
)}
<section className="mini-card">
<div style={{ fontSize: 16, fontWeight: 700 }}>프로젝트별 금액</div>
<div className="subtle" style={{ marginTop: 6 }}>연결된 프로젝트들 계정에 포함된 지출입니다.</div>
{(lifecycleAccountDetailModal.detail.projects || []).length ? (
<div style={{ display: "grid", gap: 10, marginTop: 12 }}>
{(lifecycleAccountDetailModal.detail.projects || []).map((item) => (
<div
key={`lifecycle-account-project-${item.project_code}`}
style={{
textAlign: "left",
border: "1px solid var(--line)",
borderRadius: 14,
background: "white",
padding: "12px 14px",
display: "grid",
gridTemplateColumns: "minmax(220px, 1fr) minmax(140px, 0.4fr)",
gap: 12,
alignItems: "center",
}}
>
<div>
<div style={{ fontWeight: 700 }}>{item.project_name || "(이름없음)"}</div>
<div className="subtle" style={{ marginTop: 4 }}>
{item.project_code || "-"} · {item.project_type || "미지정"}
{!Boolean(lifecycleAccountDetailModal.show_allocation_formula) && (
<>
<section className="mini-card">
<div style={{ fontSize: 16, fontWeight: 700 }}>프로젝트별 금액</div>
<div className="subtle" style={{ marginTop: 6 }}>연결된 프로젝트들 계정에 포함된 지출입니다.</div>
{(lifecycleAccountDetailModal.detail.projects || []).length ? (
<div style={{ display: "grid", gap: 10, marginTop: 12 }}>
{(lifecycleAccountDetailModal.detail.projects || []).map((item) => (
<div
key={`lifecycle-account-project-${item.project_code}`}
style={{
textAlign: "left",
border: "1px solid var(--line)",
borderRadius: 14,
background: "white",
padding: "12px 14px",
display: "grid",
gridTemplateColumns: "minmax(220px, 1fr) minmax(140px, 0.4fr)",
gap: 12,
alignItems: "center",
}}
>
<div>
<div style={{ fontWeight: 700 }}>{item.project_name || "(이름없음)"}</div>
<div className="subtle" style={{ marginTop: 4 }}>
{item.project_code || "-"} · {item.project_type || "미지정"}
</div>
</div>
<div style={{ textAlign: "right", fontWeight: 700 }}>{fmt(item.expense_supply_sum || 0)}</div>
</div>
</div>
<div style={{ textAlign: "right", fontWeight: 700 }}>{fmt(item.expense_supply_sum || 0)}</div>
</div>
))}
</div>
) : (
<div className="empty-state">표시할 프로젝트가 없습니다.</div>
)}
</section>
<section className="mini-card">
<div style={{ fontSize: 16, fontWeight: 700 }}>거래내역</div>
<div className="subtle" style={{ marginTop: 6 }}> 계정에 포함된 출금 거래를 확인합니다.</div>
{(lifecycleAccountDetailModal.detail.transactions || []).length ? (
<div className="table-wrap" style={{ marginTop: 12 }}>
<table className="data-table">
<thead>
<tr>
<th>거래일</th>
<th>프로젝트</th>
<th>거래처</th>
<th>적요</th>
<th>공급가액</th>
</tr>
</thead>
<tbody>
{(lifecycleAccountDetailModal.detail.transactions || []).map((row, index) => (
<tr key={`lifecycle-account-transaction-${index}`}>
<td>{row.transaction_date || "-"}</td>
<td>
<div>{row.project_name || "프로젝트명 없음"}</div>
<div className="table-sub">{row.project_code || "-"}</div>
</td>
<td>{row.vendor_name || "-"}</td>
<td>{row.description || "-"}</td>
<td>{fmt(row.allocated_supply_amount ?? row.supply_amount ?? 0)}</td>
</tr>
))}
</tbody>
</table>
</div>
) : (
<div className="empty-state">표시할 거래내역이 없습니다.</div>
)}
</section>
</div>
) : (
<div className="empty-state">표시할 프로젝트가 없습니다.</div>
)}
</section>
<section className="mini-card">
<div style={{ fontSize: 16, fontWeight: 700 }}>거래내역</div>
<div className="subtle" style={{ marginTop: 6 }}> 계정에 포함된 출금 거래를 확인합니다.</div>
{(lifecycleAccountDetailModal.detail.transactions || []).length ? (
<div className="table-wrap" style={{ marginTop: 12 }}>
<table className="data-table">
<thead>
<tr>
<th>거래일</th>
<th>프로젝트</th>
<th>거래처</th>
<th>적요</th>
<th>공급가액</th>
</tr>
</thead>
<tbody>
{(lifecycleAccountDetailModal.detail.transactions || []).map((row, index) => (
<tr key={`lifecycle-account-transaction-${index}`}>
<td>{row.transaction_date || "-"}</td>
<td>
<div>{row.project_name || "프로젝트명 없음"}</div>
<div className="table-sub">{row.project_code || "-"}</div>
</td>
<td>{row.vendor_name || "-"}</td>
<td>{row.description || "-"}</td>
<td>{fmt(row.allocated_supply_amount ?? row.supply_amount ?? 0)}</td>
</tr>
))}
</tbody>
</table>
</div>
) : (
<div className="empty-state">표시할 거래내역이 없습니다.</div>
)}
</section>
</>
)}
</div>
</>