pharmacy-pos-qr-system/backend/check_lasix.py
thug0bin 0ae4ae66f0 fix(baekje): 장바구니 담기 시 internal_code 사용하도록 수정
- kd_code 대신 internal_code로 장바구니 추가
- internal_code 없으면 검색 후 규격 매칭으로 찾기
- 백제 장바구니 담기 정상 작동 확인
2026-03-07 21:29:00 +09:00

48 lines
1.7 KiB
Python

# -*- 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()
# 어제 (3월 6일) 주문 조회
result = session.get_order_list('2026-03-06', '2026-03-06')
if result.get('success'):
# KD코드 매핑
for order in result.get('orders', []):
items = order.get('items', [])
if items:
session._enrich_kd_codes(items)
print("=== 어제 라식스 주문 상세 ===")
total_boxes = 0
for order in result.get('orders', []):
for item in order.get('items', []):
name = item.get('product_name', '')
if '라식스' in name:
status = item.get('status', '')
qty = item.get('quantity', 0)
spec = item.get('spec', '')
internal = item.get('product_code', '')
kd = item.get('kd_code', '')
order_num = order.get('order_num', '')
print(f" 주문번호: {order_num}")
print(f" 제품명: {name}")
print(f" 내부코드: {internal}")
print(f" KD코드: {kd}")
print(f" spec: {spec}")
print(f" 수량: {qty}박스")
print(f" 상태: {status}")
print()
if '취소' not in status and '삭제' not in status:
total_boxes += qty
print(f"=== 합계 (취소 제외): {total_boxes}박스 ===")
else:
print(f"오류: {result.get('error')}")