fix(performance): 카페24 환불합계를 일별 매출내역과 같게 — 적립금 환불 + 네이버페이 취소
실데이터 대조 결과 카페24 일별 매출 환불합계 =
환불 목록(실제 환불액 + 적립금·예치금 환불)
+ 환불 목록에 없는 취소·반품(네이버페이 취소 등, 품목 취소일 기준)
9/26: 178,220 + 1,080 + 96,500 = 275,800, 9/27: 145,000 + 55,800 = 200,800 일치.
- normalize_refund 금액에 적립금·예치금 환불 포함(refund_total)
- unrefunded_claims: orders date_type=cancel_date|return_complete_date 의 C40~43/R40~43
품목 중 앞뒤 60일 환불 목록에 없는 주문 → CANCEL/RETURN 사건(c24:{품목코드}-CL)
- 대조 화면 환불합계를 적용 규칙으로 표시 + "적용 규칙" 후보
- 테스트 추가
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -509,11 +509,14 @@
|
||||
[" 참고: 실결제금액", s.payment_amount, m.payment_amount, "sub"],
|
||||
[" 참고: 적립금 사용", s.points_spent_amount, m.points_spent_amount, "sub"],
|
||||
[" 참고: 예치금 사용", s.credits_spent_amount, m.credits_spent_amount, "sub"],
|
||||
["환불 건수", rs.count, rm.count, "cnt"],
|
||||
["환불합계(실제 환불액)", rs.actual_refund_amount, rm.actual_refund_amount, "key"],
|
||||
[" 참고: 환불 적립금", rs.used_points, rm.used_points, "sub"],
|
||||
[" 참고: 환불 예치금", rs.used_credits, rm.used_credits, "sub"],
|
||||
["순매출(결제합계 − 환불합계)", s.total - rs.actual_refund_amount, m.total - rm.actual_refund_amount, "key"],
|
||||
["환불 건수(환불 목록)", rs.count, rm.count, "cnt"],
|
||||
[" · 실제 환불액", rs.actual_refund_amount, rm.actual_refund_amount, "sub"],
|
||||
[" · 적립금 환불", rs.used_points, rm.used_points, "sub"],
|
||||
[" · 예치금 환불", rs.used_credits, rm.used_credits, "sub"],
|
||||
["환불 목록 없는 취소·반품 품목 수(네이버페이 등)", rs.no_record_count, rm.no_record_count, "cnt"],
|
||||
[" · 취소·반품 금액", rs.no_record, rm.no_record, "sub"],
|
||||
["환불합계", rs.total, rm.total, "key"],
|
||||
["순매출(결제합계 − 환불합계)", s.total - rs.total, m.total - rm.total, "key"],
|
||||
]);
|
||||
out.innerHTML = '<table class="perf-table" style="margin-top:8px"><thead><tr><th class="perf-th-label">' + esc(r.date) +
|
||||
"</th><th>카페24 열(자체몰 채널)</th><th>다른 쇼핑몰 열(외부 마켓)</th></tr></thead><tbody>" +
|
||||
@@ -534,7 +537,7 @@
|
||||
return '<h4 class="perf-h" style="margin:14px 0 6px">환불 기준 비교 — 카페24 화면의 그날 "환불합계"와 같은 칸을 찾아 주세요</h4>' +
|
||||
'<table class="perf-table"><thead><tr><th class="perf-th-label">기준</th><th>건수</th><th>실제 환불액</th>' +
|
||||
"<th>적립금·예치금 환불</th><th>합계(포함)</th></tr></thead><tbody>" +
|
||||
row("환불완료일 기준 · 완료 <span class='perf-pill is-ok'>현재 적용</span>", b.completed, "perf-row-week") +
|
||||
row("환불완료일 기준 · 완료 <span class='perf-pill is-ok'>적용(합계 포함 칸)</span>", b.completed, "perf-row-week") +
|
||||
row("환불접수일 기준 · 전체 상태", b.accepted_all) +
|
||||
(b.by_pay_date ? row("결제일 기준 · 그날 결제한 주문의 환불(오늘까지" +
|
||||
(b.by_pay_date.refund_dates.length ? ", 환불일 " + esc(b.by_pay_date.refund_dates.join(", ")) : "") + ")", b.by_pay_date) : "") +
|
||||
|
||||
Reference in New Issue
Block a user