fix(performance): 네이버 주문 내역 금액 칸 = 배송비 뺀 판매금액 · 맨 아래 그날 매출 계산식

저장 금액(판매금액 + 배송비)을 그대로 보여 배송비 칸과 겹쳐 보이던 문제

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 16:56:25 +09:00
parent 962fed151a
commit 8c1cc3e7bb
6 changed files with 21 additions and 13 deletions
+3 -2
View File
@@ -496,7 +496,8 @@ class PerformanceDBStore:
" event_date, sales_date, product_name, option_name, quantity, amount, "
" discount_amount, order_status, is_sample, "
# 주문 내역 칸(2026-10-19) — 카페24 적립금(결제 +, 환불 −) · 네이버 배송비 · 네이버 환불금액(raw_data 의 숫자만)
" raw_data ->> 'points' AS points, raw_data ->> 'ship' AS ship, raw_data ->> 'refund' AS refund "
" raw_data ->> 'points' AS points, raw_data ->> 'ship' AS ship, raw_data ->> 'refund' AS refund, "
" raw_data ->> 'goods' AS goods " # 네이버 판매금액(배송비 뺀 값) — 주문 내역 '판매금액' 칸
"FROM perf_sales_events WHERE marketplace_code = %s AND sales_date BETWEEN %s AND %s "
"ORDER BY sales_date, external_order_id, event_type LIMIT %s",
(code, start, end, limit),
@@ -504,7 +505,7 @@ class PerformanceDBStore:
out = []
for r in rows:
row = {k: _iso(v) for k, v in r.items()}
for k in ("points", "ship", "refund"):
for k in ("points", "ship", "refund", "goods"):
try:
row[k] = int(round(float(row[k]))) if row.get(k) not in (None, "") else None
except (TypeError, ValueError):