diff --git a/app/modules/dispatch/db.py b/app/modules/dispatch/db.py index 3f7082f..eba5935 100644 --- a/app/modules/dispatch/db.py +++ b/app/modules/dispatch/db.py @@ -126,8 +126,10 @@ class DispatchStore: rows = conn.execute( """ SELECT b.*, - COUNT(p.id) AS parcel_count, - COUNT(p.id) FILTER (WHERE p.courier_scanned) AS scanned_count + COUNT(p.id) AS parcel_count, + COUNT(p.id) FILTER ( + WHERE p.label_attached AND p.handed_to_kagayaku + ) AS done_count FROM dispatch_batches b LEFT JOIN dispatch_parcels p ON p.batch_id = b.id GROUP BY b.id @@ -301,7 +303,7 @@ class DispatchStore: elif isinstance(v, date): out[k] = v.isoformat() for k in ("id", "batch_id", "parcel_id", "seq", "quantity", - "parcel_count", "scanned_count", "total_qty", "box_count"): + "parcel_count", "done_count", "total_qty", "box_count"): if k in out and out[k] is not None: try: out[k] = int(out[k]) diff --git a/app/modules/dispatch/store.py b/app/modules/dispatch/store.py index b4b6aad..61f3d85 100644 --- a/app/modules/dispatch/store.py +++ b/app/modules/dispatch/store.py @@ -27,14 +27,13 @@ from urllib.parse import quote STATUS_FIELDS: tuple[str, ...] = ( "label_attached", "handed_to_kagayaku", - "courier_scanned", ) STATUS_LABELS: dict[str, dict[str, str]] = { - "product_ready": {"ko": "상품준비 완료", "en": "Product Ready"}, + "product_ready": {"ko": "상품준비", "en": "Product Ready"}, "packed": {"ko": "포장완료", "en": "Packed"}, - "label_attached": {"ko": "라벨부착 완료", "en": "Label Attached"}, - "handed_to_kagayaku": {"ko": "Kagayaku 전달 완료", "en": "Handed to Kagayaku"}, + "label_attached": {"ko": "라벨부착", "en": "Label Attached"}, + "handed_to_kagayaku": {"ko": "Kagayaku 전달", "en": "Handed to Kagayaku"}, "courier_scanned": {"ko": "택배스캔 확인", "en": "Courier Scanned"}, } @@ -265,7 +264,7 @@ def courier_logo_url(provider: Any) -> str: # 매핑 없는 배송사는 링크 없이 텍스트로 표시(courier_tracking_url 가 "" 반환). _COURIER_TRACK_URL: dict[str, str] = { "ninjavan": "https://www.ninjavan.co/en-my/tracking?id={t}", - "jnt": "https://www.jtexpress.my/tracking?billcode={t}", + "jnt": "https://www.jtexpress.my/index/query/gzquery.html?bills={t}", "flash": "https://www.flashexpress.my/fle/tracking?se={t}", "citylink": "https://www.citylinkexpress.com/tracking-result/?track_no={t}", "poslaju": "https://track.pos.com.my/postal-services/quick-access/?track-trace&trackingNo03={t}", diff --git a/app/modules/dispatch/templates/dispatch/batches.html b/app/modules/dispatch/templates/dispatch/batches.html index 3d8b67c..6df0ace 100644 --- a/app/modules/dispatch/templates/dispatch/batches.html +++ b/app/modules/dispatch/templates/dispatch/batches.html @@ -15,7 +15,7 @@ 날짜플랫폼배치명 박스 - 스캔완료 + 완료 생성시각 @@ -27,9 +27,9 @@ {{ b.batch_name or '(이름없음)' }} {{ b.parcel_count }} - {% if b.parcel_count and b.scanned_count == b.parcel_count %} - {{ b.scanned_count }} ✓ - {% else %}{{ b.scanned_count }}{% endif %} + {% if b.parcel_count and b.done_count == b.parcel_count %} + {{ b.done_count }} ✓ + {% else %}{{ b.done_count }}{% endif %} {{ b.created_at }} diff --git a/app/modules/dispatch/templates/dispatch/detail.html b/app/modules/dispatch/templates/dispatch/detail.html index f34ec7c..2cb32bf 100644 --- a/app/modules/dispatch/templates/dispatch/detail.html +++ b/app/modules/dispatch/templates/dispatch/detail.html @@ -15,8 +15,9 @@ .dsp-meta b { color:#0f172a; } .dsp-order { font-size:15px;line-height:1.3;color:#334155;word-break:break-all; } .dsp-order b { display:block;font-size:11px;font-weight:600;color:#64748b;letter-spacing:.5px; } - .dsp-order span { font-size:22px;font-weight:800;color:#0f172a; } - .dsp-track-link { color:#2563eb;font-weight:700;text-decoration:underline;text-underline-offset:2px; } + .dsp-order span { font-size:27px;font-weight:800;color:#0f172a;letter-spacing:.2px; } + .dsp-track-link { color:#2563eb;font-weight:700;text-decoration:underline; + text-decoration-thickness:2px;text-underline-offset:3px;cursor:pointer; } .dsp-items { list-style:none;margin:0;padding:8px 0;border-top:1px dashed #e2e8f0;border-bottom:1px dashed #e2e8f0; } .dsp-items li { font-size:16px;font-weight:600;color:#0f172a;padding:2px 0; } .dsp-items .qty { color:#2563eb; } @@ -49,7 +50,6 @@ - @@ -57,12 +57,11 @@
{% for p in parcels %} - {% set is_done = p.label_attached and p.handed_to_kagayaku and p.courier_scanned %} + {% set is_done = p.label_attached and p.handed_to_kagayaku %}
{% set logo = p.shipping_provider | courier_logo %} {% if logo %}