feat: GUI 칼럼 설정 저장, 010 전화번호 UX 개선, 품목 상세 조회
- GUI: SALES_COLUMNS 상수 정의, 칼럼 폭/윈도우 위치 gui_settings.json에 저장 - 전화번호 입력: 적립페이지/마이페이지에서 010 고정 + 뒷번호만 입력 - 적립페이지: MSSQL SALE_SUB에서 구매 품목 조회 및 토글 표시 - 마이페이지: 적립 내역 탭 시 품목 상세 AJAX 조회 (캐시 적용) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -536,8 +536,29 @@ def claim():
|
||||
if not success:
|
||||
return render_template('error.html', message=message)
|
||||
|
||||
# 간편 적립 페이지 렌더링
|
||||
return render_template('claim_form.html', token_info=token_info)
|
||||
# MSSQL에서 구매 품목 조회
|
||||
sale_items = []
|
||||
try:
|
||||
session = db_manager.get_session('PM_PRES')
|
||||
sale_sub_query = text("""
|
||||
SELECT
|
||||
ISNULL(G.GoodsName, '(약품명 없음)') AS goods_name,
|
||||
S.SL_NM_item AS quantity,
|
||||
S.SL_TOTAL_PRICE AS total
|
||||
FROM SALE_SUB S
|
||||
LEFT JOIN PM_DRUG.dbo.CD_GOODS G ON S.DrugCode = G.DrugCode
|
||||
WHERE S.SL_NO_order = :transaction_id
|
||||
ORDER BY S.DrugCode
|
||||
""")
|
||||
rows = session.execute(sale_sub_query, {'transaction_id': transaction_id}).fetchall()
|
||||
sale_items = [
|
||||
{'name': r.goods_name, 'qty': int(r.quantity or 0), 'total': int(r.total or 0)}
|
||||
for r in rows
|
||||
]
|
||||
except Exception as e:
|
||||
logging.warning(f"품목 조회 실패 (transaction_id={transaction_id}): {e}")
|
||||
|
||||
return render_template('claim_form.html', token_info=token_info, sale_items=sale_items)
|
||||
|
||||
|
||||
@app.route('/api/claim', methods=['POST'])
|
||||
@@ -647,9 +668,9 @@ def my_page():
|
||||
user = dict(user_raw)
|
||||
user['created_at'] = utc_to_kst_str(user_raw['created_at'])
|
||||
|
||||
# 적립 내역 조회
|
||||
# 적립 내역 조회 (transaction_id 포함)
|
||||
cursor.execute("""
|
||||
SELECT points, balance_after, reason, description, created_at
|
||||
SELECT points, balance_after, reason, description, created_at, transaction_id
|
||||
FROM mileage_ledger
|
||||
WHERE user_id = ?
|
||||
ORDER BY created_at DESC
|
||||
|
||||
Reference in New Issue
Block a user