feat(malaysia): 창고 랙 보기 페이지

최근(취소 제외) 재고조사의 랙 입력을 칸별로 한눈에 보는 읽기전용 메뉴.
각 칸에 상품명·박스수×입수량=총개수, 칸 합계(∑) 표시.

- nav: '창고 랙 보기' 탭 추가(active_tab='rack')
- router: GET /malaysia/rack — latest_stocktake → list_rack_entries 칸별 그룹
- 템플릿 rack_view.html — Side A/B 세로 적층, 칸별 아이템 목록
- i18n 키 추가(Rack View 등)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 16:48:07 +09:00
parent 4c7eb9467f
commit 1e0e69fcbe
5 changed files with 125 additions and 1 deletions
+34
View File
@@ -174,6 +174,40 @@ async def index(request: Request) -> HTMLResponse:
return render_template(request, "malaysia/index.html", ctx)
@router.get("/rack", response_class=HTMLResponse)
async def rack_view(request: Request) -> HTMLResponse:
"""창고 랙 보기 — 최근(취소 제외) 재고조사의 랙 입력을 칸별로 한눈에.
읽기 전용. 각 칸에 어떤 상품이 몇 박스(× 입수량 = 총개수) 있는지 표시.
"""
from app.main import render_template # noqa: WPS433
guard = _guard(request)
if not isinstance(guard, tuple):
return guard
st, user = guard
wh = _selected_wh(request, st)
latest = st.latest_stocktake(warehouse_code=wh)
rack_by_cell: dict[str, list[dict[str, Any]]] = {}
names = st.item_name_map()
if latest:
for e in st.list_rack_entries(stocktake_id=latest["id"]):
e["item_name"] = names.get(e["sku_code"], e["sku_code"])
e["total"] = int(e["units_per_box"]) * int(e["box_count"])
rack_by_cell.setdefault(e["cell_code"], []).append(e)
ctx = _base_ctx(request, user, st, wh=wh)
ctx.update(
{
"page_title": "말레이시아 재고관리 — 창고 랙",
"page_subtitle": f"{wh} · 랙 보기",
"rack_layout": store.rack_layout(),
"rack_by_cell": rack_by_cell,
"stocktake": latest,
}
)
return render_template(request, "malaysia/rack_view.html", ctx)
@router.post("/reset")
async def reset_data(
request: Request, user: dict[str, Any] = Depends(_require_user)