fix(wh-stock-status): 기본 '품목 가로' + 상단 전체 합계 행 추가
Deploy momo-erp / deploy (push) Successful in 2m10s
Deploy momo-erp / deploy (push) Successful in 2m10s
This commit is contained in:
@@ -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) => (
|
||||
|
||||
Reference in New Issue
Block a user