fix: 지오영 주문량 집계 시 취소/삭제 상태 제외

- status에 '취소' 또는 '삭제' 포함 시 집계 제외
- 예: '취소(삭제)' 상태
This commit is contained in:
thug0bin 2026-03-07 18:14:00 +09:00
parent 20fc528c2b
commit 232a77006a
2 changed files with 30 additions and 0 deletions

25
backend/check_status.py Normal file
View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0, 'c:/Users/청춘약국/source/pharmacy-wholesale-api')
from dotenv import load_dotenv
load_dotenv('c:/Users/청춘약국/source/pharmacy-wholesale-api/.env')
from wholesale import GeoYoungSession
session = GeoYoungSession()
session.login()
result = session.get_order_list('2026-03-01', '2026-03-07')
if result.get('success'):
status_set = set()
for order in result.get('orders', []):
for item in order.get('items', []):
status = item.get('status', '').strip()
if status:
status_set.add(status)
print("=== 발견된 상태값들 ===")
for s in sorted(status_set):
print(f" '{s}'")
else:
print(f"오류: {result.get('error')}")

View File

@ -656,6 +656,11 @@ def api_geoyoung_orders_by_kd():
for order in orders:
# 지오영은 get_order_list에서 items도 같이 반환
for item in order.get('items', []):
# 취소/삭제 상태 제외
status = item.get('status', '').strip()
if '취소' in status or '삭제' in status:
continue
kd_code = item.get('kd_code', '')
if not kd_code:
continue