feat(performance): 토스쇼핑 원본 데이터 확인에 환불 후보 3가지(정산 REFUND·주문 취소 시각·클레임 환불 완료)
- 9/6 실데이터: 매출 29,600 일치, 환불 11,900 은 정산 건별 REFUND 에 없음(다른 날 주문을 9/6 에 환불) - 후보 ① 정산 REFUND(현재 규칙) ② orders/v2 canceledAt(기간 90일 전 주문까지) ③ claims refundedDt(isRefunded) — 날짜별 합계를 나란히 + 건별(주문번호·금액·메모), 화면 숫자와 같은 후보로 규칙을 정한다 - 클레임 목록 개인정보(연락처·수거 주소·요청 사유·사진) 값·합계 숨김, 송장번호 합계도 숨김 - performance.js 캐시 버전 20261001c, 테스트·문서 갱신 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1008,7 +1008,31 @@
|
||||
["orders", "amount", "claimed", "ship"].map(function (k) {
|
||||
return '<td class="perf-num"><b>' + fmt(r.days.reduce(function (a, d) { return a + (d[k] || 0); }, 0)) + "</b></td>";
|
||||
}).join("") + "</tr></tbody></table>" : "";
|
||||
out.innerHTML = summary + days + (details || '<p class="perf-muted" style="margin-top:8px">그 기간에 조회된 주문이 없습니다. 쇼핑몰 관리자 화면에서 매출이 있던 날로 다시 해 보세요.</p>');
|
||||
// 환불 후보(토스쇼핑) — 후보별 날짜 합계를 나란히, 아래에 건별 목록(주문번호·금액·메모)
|
||||
const rc = r.refund_candidates || [];
|
||||
const candDays = (r.days || []).map(function (d) { return d.date; });
|
||||
const cands = rc.length ? '<h4 class="perf-h" style="margin:14px 0 6px">환불 후보 — 쇼핑몰 화면 "환불"과 같은 열을 알려 주세요</h4>' +
|
||||
'<table class="perf-table"><thead><tr><th class="perf-th-label">날짜</th>' +
|
||||
rc.map(function (c) { return "<th>" + esc(c.label) + "</th>"; }).join("") + "</tr></thead><tbody>" +
|
||||
candDays.map(function (dt) {
|
||||
return '<tr><td class="perf-td-label">' + esc(dt) + "</td>" + rc.map(function (c) {
|
||||
return '<td class="perf-num">' + (c.error ? "" : fmt((c.days || {})[dt] || 0)) + "</td>";
|
||||
}).join("") + "</tr>";
|
||||
}).join("") + '<tr><td class="perf-td-label"><b>합계</b></td>' + rc.map(function (c) {
|
||||
if (c.error) return '<td><span class="perf-pill is-bad">실패</span> <span class="perf-muted" style="white-space:normal">' + esc(c.error) + "</span></td>";
|
||||
const t = Object.keys(c.days || {}).reduce(function (a, k) { return a + c.days[k]; }, 0);
|
||||
return '<td class="perf-num"><b>' + fmt(t) + "</b></td>";
|
||||
}).join("") + "</tr></tbody></table>" +
|
||||
rc.filter(function (c) { return !c.error && (c.rows || []).length; }).map(function (c) {
|
||||
return '<p class="perf-muted" style="margin:10px 0 4px">' + esc(c.label) + " — " + fmt(c.rows.length) + "건</p>" +
|
||||
'<table class="perf-table"><thead><tr><th class="perf-th-label">날짜</th><th class="perf-th-label">주문번호</th>' +
|
||||
'<th class="perf-th-label">주문상품</th><th>금액</th><th class="perf-th-label">메모</th></tr></thead><tbody>' +
|
||||
c.rows.map(function (x) {
|
||||
return '<tr><td class="perf-td-label">' + esc(x.date) + "</td><td>" + esc(x.orderId) + "</td><td>" + esc(x.orderProductId) +
|
||||
'</td><td class="perf-num">' + fmt(x.amount) + '</td><td class="perf-muted">' + esc(x.note) + "</td></tr>";
|
||||
}).join("") + "</tbody></table>";
|
||||
}).join("") : "";
|
||||
out.innerHTML = summary + days + cands + (details ||'<p class="perf-muted" style="margin-top:8px">그 기간에 조회된 주문이 없습니다. 쇼핑몰 관리자 화면에서 매출이 있던 날로 다시 해 보세요.</p>');
|
||||
} catch (err) {
|
||||
out.innerHTML = '<p class="perf-notice is-warn">' + esc(err.message) + "</p>";
|
||||
} finally { probe.disabled = false; }
|
||||
|
||||
Reference in New Issue
Block a user