diff --git a/app/modules/cupang/db.py b/app/modules/cupang/db.py index bb98e18..f6ad3dd 100644 --- a/app/modules/cupang/db.py +++ b/app/modules/cupang/db.py @@ -323,14 +323,13 @@ class CupangDBStore: row = conn.execute( """ INSERT INTO cupang_shipments - (document_no, created_by, document_date, ship_date, + (created_by, document_date, ship_date, center_arrival_date, center_id, center_name_snapshot, ship_method, outbound_summary, worker, status, memo) - VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s) + VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s) RETURNING * """, ( - h["document_no"] or None, created_by.lower().strip(), h["document_date"], h["ship_date"], @@ -360,7 +359,7 @@ class CupangDBStore: row = conn.execute( """ UPDATE cupang_shipments - SET document_no = %s, document_date = %s, ship_date = %s, + SET document_date = %s, ship_date = %s, center_arrival_date = %s, center_id = %s, center_name_snapshot = %s, ship_method = %s, outbound_summary = %s, worker = %s, memo = %s @@ -368,7 +367,6 @@ class CupangDBStore: RETURNING * """, ( - h["document_no"] or None, h["document_date"], h["ship_date"], h["center_arrival_date"], @@ -526,7 +524,6 @@ class CupangDBStore: center_id = None return { - "document_no": str(header.get("document_no") or "").strip(), "document_date": document_date, "ship_date": ship_date, "center_arrival_date": center_arrival_date, diff --git a/app/modules/cupang/router.py b/app/modules/cupang/router.py index 3f72dd4..b90c4d0 100644 --- a/app/modules/cupang/router.py +++ b/app/modules/cupang/router.py @@ -248,7 +248,6 @@ async def new_form(request: Request) -> HTMLResponse: async def create( request: Request, lines_json: str = Form("[]"), - document_no: str = Form(""), document_date: str = Form(...), ship_date: str = Form(...), center_arrival_date: str = Form(...), @@ -257,7 +256,6 @@ async def create( ship_method: str = Form("택배"), outbound_summary: str = Form(""), worker: str = Form(""), - status: str = Form("작성중"), memo: str = Form(""), user: dict[str, Any] = Depends(_require_user), ) -> RedirectResponse: @@ -265,7 +263,6 @@ async def create( if store is None: raise HTTPException(status_code=503, detail="cupang_db 미설정") header = { - "document_no": document_no, "document_date": document_date, "ship_date": ship_date, "center_arrival_date": center_arrival_date, @@ -274,7 +271,6 @@ async def create( "ship_method": ship_method, "outbound_summary": outbound_summary, "worker": worker, - "status": status, "memo": memo, } try: @@ -351,7 +347,6 @@ async def update( request: Request, shipment_id: int, lines_json: str = Form("[]"), - document_no: str = Form(""), document_date: str = Form(...), ship_date: str = Form(...), center_arrival_date: str = Form(...), @@ -367,7 +362,6 @@ async def update( if store is None: raise HTTPException(status_code=503, detail="cupang_db 미설정") header = { - "document_no": document_no, "document_date": document_date, "ship_date": ship_date, "center_arrival_date": center_arrival_date, diff --git a/app/modules/cupang/store.py b/app/modules/cupang/store.py index 92d6400..6280119 100644 --- a/app/modules/cupang/store.py +++ b/app/modules/cupang/store.py @@ -21,7 +21,7 @@ STATUSES: tuple[str, ...] = ( ) # 출고방식 기본 후보 (자유 입력 허용, 아래는 select 기본값) -SHIP_METHODS: tuple[str, ...] = ("택배", "직접배송", "화물", "기타") +SHIP_METHODS: tuple[str, ...] = ("택배", "직접배송", "화물", "파렛트", "기타") # 엑셀/시트 컬럼 순서 — 기존 구글시트와 동일하게 유지 SHEET_COLUMNS: tuple[str, ...] = ( diff --git a/app/modules/cupang/templates/cupang/detail.html b/app/modules/cupang/templates/cupang/detail.html index 4ac6e36..b9c5de8 100644 --- a/app/modules/cupang/templates/cupang/detail.html +++ b/app/modules/cupang/templates/cupang/detail.html @@ -6,18 +6,7 @@
- 수정 - 엑셀 - 달력으로 - -
- - -
+ ◀◀ 달력
@@ -28,6 +17,8 @@ onsubmit="return confirm('이 출고를 완전 삭제합니다(복구 불가, 품목 포함). 계속할까요?');">
+ + 수정
@@ -48,7 +39,6 @@
입고센터
{{ shipment.center_name_snapshot or '—' }}
출고방식
{{ shipment.ship_method }}
작업자
{{ shipment.worker or '—' }}
-
문서번호
{{ shipment.document_no or '—' }}
출고/박스 요약
{{ shipment.outbound_summary or '—' }}
메모
{{ shipment.memo or '—' }}
diff --git a/app/modules/cupang/templates/cupang/form.html b/app/modules/cupang/templates/cupang/form.html index 29bc984..75505b2 100644 --- a/app/modules/cupang/templates/cupang/form.html +++ b/app/modules/cupang/templates/cupang/form.html @@ -9,8 +9,10 @@
- -
+
+ + +

공통 헤더

- -
+ +

품목 라인

@@ -90,6 +81,8 @@
+
+
{% if mode == 'edit' %} diff --git a/app/static/cupang.css b/app/static/cupang.css index b07e11a..81c8737 100644 --- a/app/static/cupang.css +++ b/app/static/cupang.css @@ -2,6 +2,8 @@ .cpg { display: flex; flex-direction: column; gap: 16px; } .cpg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } +/* 맨 오른쪽으로 밀기 (수정 버튼) */ +.cpg-push-right { margin-left: auto; } /* ── 레이아웃: 왼쪽 큰 달력 + 오른쪽 리스트 ── */ .cpg-layout { @@ -68,6 +70,16 @@ /* ── 폼 ── */ .cpg-form-card { padding: 16px; margin-bottom: 16px; } + +/* 공통 헤더(좌) + 품목 라인(우) 2열 */ +.cpg-form-2col { + display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; +} +.cpg-form-head { flex: 1 1 380px; min-width: 0; margin-bottom: 0; } +.cpg-form-lines { flex: 1 1 520px; min-width: 0; margin-bottom: 0; } +@media (max-width: 900px) { + .cpg-form-head, .cpg-form-lines { flex-basis: 100%; } +} .cpg-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; } .cpg-card-head h2 { font-size: 16px; font-weight: 600; margin: 0; } diff --git a/scripts/sql/cupang_db_002_drop_document_no.sql b/scripts/sql/cupang_db_002_drop_document_no.sql new file mode 100644 index 0000000..b478845 --- /dev/null +++ b/scripts/sql/cupang_db_002_drop_document_no.sql @@ -0,0 +1,21 @@ +-- ===================================================================== +-- cupang_db 마이그레이션 002 — cupang_shipments.document_no 컬럼 제거 +-- ===================================================================== +-- 사유: 출고 폼에서 "문서번호" 항목 제거(미사용). +-- 멱등: IF EXISTS. 운영 적용 전 백업 권장(DROP COLUMN 은 되돌릴 수 없음). +-- +-- 실행: +-- docker exec -i postgres-db psql -U postgres -d cupang_db \ +-- < scripts/sql/cupang_db_002_drop_document_no.sql +-- +-- 주의: 이 컬럼에 보관된 값이 있으면 함께 삭제된다. 현재 폼에서 입력받지 +-- 않으므로 값이 없거나 NULL 일 가능성이 높다. 확인 후 실행: +-- SELECT count(*) FROM cupang_shipments WHERE document_no IS NOT NULL AND document_no <> ''; +-- ===================================================================== + +\set ON_ERROR_STOP on +\connect cupang_db + +ALTER TABLE cupang_shipments DROP COLUMN IF EXISTS document_no; + +SELECT 'cupang_db 002 done' AS status; diff --git a/scripts/sql/cupang_db_init.sql b/scripts/sql/cupang_db_init.sql index 709861b..c09c63f 100644 --- a/scripts/sql/cupang_db_init.sql +++ b/scripts/sql/cupang_db_init.sql @@ -116,7 +116,6 @@ CREATE TRIGGER trg_cupang_products_updated -- ════════════════════════════════════════════════════════════ CREATE TABLE IF NOT EXISTS cupang_shipments ( id BIGSERIAL PRIMARY KEY, - document_no TEXT UNIQUE, created_by TEXT NOT NULL, document_date DATE NOT NULL, ship_date DATE NOT NULL,