fix(wh-stock-status): 기본 '품목 가로' + 상단 전체 합계 행 추가
Deploy momo-erp / deploy (push) Successful in 2m10s

This commit is contained in:
chpark
2026-05-15 01:23:13 +09:00
parent a02015641c
commit 51f6bd653b
+17 -1
View File
@@ -199,7 +199,7 @@ export default function InventoryPage() {
{matrix.items.length === 0 ? (
<div className="text-center py-12 text-slate-400"> . .</div>
) : viewMode === "by-item" ? (
/* 품목 가로 (기본): 헤더=품목, 행=창고 */
/* 품목 가로 (기본): 헤더=품목, 행=창고. 상단에 품목별 전체 합계 강조 행. */
<table className="text-sm border-collapse">
<thead className="bg-slate-50 text-slate-600 sticky top-0">
<tr>
@@ -211,6 +211,22 @@ export default function InventoryPage() {
</th>
))}
</tr>
{/* 전체 합계 행 — 헤더 바로 아래, sticky */}
<tr className="bg-emerald-50 border-b-2 border-emerald-300">
<th className="text-left px-3 py-2 sticky left-0 bg-emerald-50 z-10 text-emerald-800 font-bold">
</th>
{matrix.items.map((it) => {
const total = matrix.warehouses.reduce(
(sum, w) => sum + (matrix.cell[it.OBJID]?.[w.OBJID]?.qty ?? 0), 0
);
return (
<th key={it.OBJID} className={`px-3 py-2 text-right tabular-nums ${total === 0 ? "text-emerald-300" : "text-emerald-800 font-bold"}`}>
{total === 0 ? "-" : `${fmt(total)} ${it.UNIT}`}
</th>
);
})}
</tr>
</thead>
<tbody className="tabular-nums">
{matrix.warehouses.map((w) => (