style(cupang): 매출 조회 조건 1행 고정 + 주차 필터, 상단 합계 KPI 제거

- 조회 조건은 flex-wrap: nowrap 로 한 줄 유지(좁은 화면은 가로 스크롤)
- 주차(week_label) 필터 추가 — 최근 주차부터 목록
- 공급가/원가/물류비/마진/순마진 합계 카드 삭제, 표 영역 높이 확대

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-02 16:13:49 +09:00
parent 0979a89ed9
commit 9ae27bce8a
9 changed files with 50 additions and 47 deletions
+14 -1
View File
@@ -679,9 +679,10 @@ class CupangDBStore:
center_name: str = "",
keyword: str = "",
po_type: str = "",
week_label: str = "",
limit: int = 5000,
) -> list[dict[str, Any]]:
"""출고일 기준 조회. 기간·센터·발주유형·검색어(품목/SKU/발주번호/바코드)."""
"""출고일 기준 조회. 기간·센터·발주유형·주차·검색어(품목/SKU/발주번호/바코드)."""
where: list[str] = []
params: list[Any] = []
if date_from:
@@ -696,6 +697,9 @@ class CupangDBStore:
if po_type:
where.append("po_type = %s")
params.append(po_type)
if week_label:
where.append("week_label = %s")
params.append(week_label)
if keyword:
where.append(
"(item_name ILIKE %s OR sku_id ILIKE %s OR po_no ILIKE %s OR barcode ILIKE %s)"
@@ -728,6 +732,15 @@ class CupangDBStore:
).fetchall()
return [r["center_name"] for r in rows]
def sales_weeks(self) -> list[str]:
"""필터용 — 매출 자료의 주차 목록(최근 주차부터)."""
with self._pool.connection() as conn:
rows = conn.execute(
"SELECT week_label, MIN(ship_date) AS d FROM cupang_sales "
"WHERE week_label <> '' GROUP BY week_label ORDER BY d DESC NULLS LAST"
).fetchall()
return [r["week_label"] for r in rows]
def create_sale(self, *, data: dict[str, Any]) -> dict[str, Any]:
row = self._normalize_sale(data)
cols = ", ".join(self.SALES_FIELDS)