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 @@