Files
dbx-main/app/modules/performance/templates/performance/settings.html
T
king 54e4e08802 feat(실적): 틱톡 탭과 틱톡 광고 API 연동
광고비 탭 오른쪽에 틱톡 탭 추가. 일자별 ROAS, 광고비, 매출을 광고비 탭과 같은 틀로 보여 준다.
실적 설정 광고 API 연동에 틱톡 추가(광고 계정 ID, 액세스 토큰, 선택 틱톡샵 ID).
채널 표(CHANNELS)에 넣지 않아 매출 실적·광고비 탭 합계에는 들어가지 않는다. DB 변경 없음.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 14:19:25 +09:00

351 lines
24 KiB
HTML

{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/performance.css?v=20261105a" />{% endblock %}
{%- macro when(v) -%}{{ (v or '')[:16] | replace('T', ' ') or '—' }}{%- endmacro -%}
{% block content %}
<section class="perf perf-settings" id="perf-settings">
{% include "performance/_tabs.html" %}
{# 일반 사용자(실적 권한)는 쇼핑몰별 수수료율만 — 사용·집계 토글·API 인증정보·연결 상태·아래 카드는 관리자만(서버 API 도 관리자만) #}
{% if is_admin and not key_info.ok %}
<div class="perf-notice is-warn">
<b>암호화 마스터 키가 없습니다.</b> {{ key_info.message }}
— 키가 없으면 API 인증정보를 저장할 수 없습니다(수수료 설정·대시보드는 사용 가능).
</div>
{% endif %}
<div class="erp-card perf-card">
<div class="perf-card-head">
<h2 class="perf-h">쇼핑몰 설정</h2>
{% if is_admin %}
<span class="perf-muted">사용 · 매출 집계 · 수동 입력 · 수수료율은 바로 저장됩니다. API 인증정보는 [설정]에서 입력합니다.
수동 입력을 켜면 실적 일자별 표에서 그 쇼핑몰 날짜 칸에 매출을 직접 넣을 수 있고, API 가 설정돼 있어도 매출 업데이트(수동·자동)에서 빠집니다.</span>
{% else %}
<span class="perf-muted">쇼핑몰별 수수료율을 설정합니다. 바로 저장되며 실적 화면의 수수료·수수료 차감 매출에 반영됩니다.</span>
{% endif %}
</div>
<div class="erp-table-wrap">
<table class="perf-table perf-set-table">
<thead>
<tr>
<th class="perf-th-label">쇼핑몰</th>
{% if is_admin %}<th>사용</th>
<th>매출 집계</th>
<th>수동 입력</th>{% endif %}
<th>수수료율</th>
{% if is_admin %}<th>API 설정</th>
<th>연결 상태</th>{% endif %}
<th>마지막 동기화</th>
{% if is_admin %}<th></th>{% endif %}
</tr>
</thead>
{# 드래그 단위(2026-10-22) = tbody 하나 — 그룹 없는 행 하나 또는 그룹 + 하위 쇼핑몰(하위는 그 안에서만 순서 변경) #}
{% for b in blocks %}
<tbody class="perf-sort-block{% if b.row.is_group %} is-group-block{% endif %}">
{% for r in [b.row] + b.children %}
{% if r.is_group %}
<tr class="perf-group-row" data-code="{{ r.code }}" data-name="{{ r.name }}" data-group="1">
<th class="perf-td-label" scope="row">
{% if is_admin %}<span class="perf-drag" title="끌어서 순서 변경(그룹은 하위 쇼핑몰과 함께 움직임)" aria-hidden="true">⠿</span>{% endif %}
<span class="perf-group-name">{{ r.name }}</span> <span class="perf-pill">그룹</span>
</th>
<td colspan="{{ 7 if is_admin else 2 }}" class="perf-muted">하위 쇼핑몰 {{ r.children }}곳 — 매출 실적에서 그룹 열 = 하위 쇼핑몰 매출 합계(수수료도 쇼핑몰별 요율로 계산해 합침)</td>
{% if is_admin %}
<td class="perf-nowrap">
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm" data-act="rename">이름 변경</button>
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm perf-del-btn" data-act="delete">삭제</button>
</td>
{% endif %}
</tr>
{% else %}
<tr data-code="{{ r.code }}" data-name="{{ r.name }}"{% if r.parent %} class="perf-child-row" data-parent="{{ r.parent }}"{% endif %}{% if r.is_custom %} data-custom="1"{% endif %}>
<th class="perf-td-label" scope="row">
{% if is_admin %}<span class="perf-drag" title="끌어서 순서 변경" aria-hidden="true">⠿</span>{% endif %}
{% if r.parent %}<span class="perf-child-mark" aria-hidden="true">└</span>{% endif %}{{ r.name }}{% if r.is_custom %} <span class="perf-pill" title="실적 설정에서 직접 추가한 쇼핑몰">직접 추가</span>{% endif %}
</th>
{% if is_admin %}
<td class="perf-center">
<label class="perf-switch" title="사용 여부">
<input type="checkbox" data-field="enabled"{% if r.enabled %} checked{% endif %} /><span></span>
</label>
</td>
<td class="perf-center">
<label class="perf-switch" title="매출 집계에 포함">
<input type="checkbox" data-field="include_in_sales"{% if r.include_in_sales %} checked{% endif %} /><span></span>
</label>
</td>
<td class="perf-center">
<label class="perf-switch" title="{% if r.manual_only %}수동 입력 전용 쇼핑몰 — API 연동이 없어 늘 켜져 있습니다{% else %}수동 입력 사용 — 켜면 실적 일자별 표에서 날짜 칸에 매출을 직접 입력(입력한 날은 API 값 대신), 매출 업데이트(수동·자동)에서 빠짐{% endif %}">
<input type="checkbox" data-field="manual_input"{% if r.manual_input or r.manual_only %} checked{% endif %}{% if r.manual_only %} disabled{% endif %} /><span></span>
</label>
</td>
{% endif %}
<td class="perf-rate-cell">
<span class="perf-rate">{% if r.rate %}{{ r.rate }}%{% else %}<span class="perf-muted">미설정</span>{% endif %}</span>
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm" data-act="rate"
data-has-history="{{ 1 if r.rate_history else 0 }}">변경{% if r.rate_history > 1 %} · 이력 {{ r.rate_history }}{% endif %}</button>
</td>
{% if is_admin %}
<td>
{% if r.manual_only %}<span class="perf-pill">수동 입력 전용</span>
{% elif r.shared %}<span class="perf-pill">공통 연동</span>
{% elif r.configured %}<span class="perf-pill is-ok">설정완료</span>
{% else %}<span class="perf-pill">미설정</span>{% endif %}
{% if r.via_cafe24 %}<span class="perf-pill is-ok" title="카페24 마켓 통합관리로 들어온 이 쇼핑몰 주문을 카페24 수집 때 함께 반영합니다">카페24 경유</span>{% endif %}
</td>
<td>
<span class="perf-status st-{{ r.status }}"
title="마지막 연결 테스트: {{ when(r.last_test_at) }}{% if r.last_error %}&#10;최근 오류({{ when(r.last_error_at) }}): {{ r.last_error }}{% endif %}">
<i></i>{{ r.status_label }}</span>
{% if r.last_error and r.status not in ('ok', 'disabled') %}<div class="perf-err">{{ r.last_error }}</div>{% endif %}
</td>
{% endif %}
<td class="perf-muted perf-nowrap" title="마지막 시도: {{ when(r.last_sync_at) }}">{{ when(r.last_success_sync_at) }}</td>
{% if is_admin %}
<td class="perf-nowrap">
{% if r.is_custom %}
<select class="erp-input perf-group-sel" data-act-group title="그룹 — 그룹으로 묶으면 매출 실적에서 그룹 열이 하위 쇼핑몰 매출 합계">
<option value="">그룹 없음</option>
{% for g in groups %}<option value="{{ g.code }}"{% if r.parent == g.code %} selected{% endif %}>{{ g.name }}</option>{% endfor %}
</select>
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm" data-act="rename">이름 변경</button>
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm perf-del-btn" data-act="delete">삭제</button>
{% elif not r.manual_only %}
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" data-act="creds">설정</button>
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" data-act="test">연결 테스트</button>
{% endif %}
</td>
{% endif %}
</tr>
{% endif %}
{% endfor %}
</tbody>
{% endfor %}
</table>
</div>
{% if is_admin %}
<div class="perf-add-row">
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" id="perf-add-shop"
title="API 연동 없이 실적 일자별 표에 매출을 직접 입력하는 쇼핑몰을 추가">+ 쇼핑몰 추가(수동 입력)</button>
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" id="perf-add-group"
title="직접 추가한 쇼핑몰을 묶는 그룹 — 그룹 매출 = 하위 쇼핑몰 매출 합계">+ 그룹 추가</button>
<span class="perf-muted">⠿ 를 끌어 순서를 바꾸면 매출 실적 열 순서에 그대로 반영됩니다. 그룹은 직접 추가한 쇼핑몰만 묶을 수 있습니다.</span>
{% if not custom_ready %}<span class="perf-notice is-warn">쇼핑몰 직접 추가·그룹은 performance_db 마이그레이션 009
(scripts/sql/performance_db_009_custom_marketplaces.sql)을 적용해야 쓸 수 있습니다.</span>{% endif %}
</div>
{% endif %}
<p class="perf-foot perf-muted">
수수료율은 <b>적용 시작일</b>부터 반영되고, 그 전 실적은 예전 요율로 계산됩니다(과거 실적이 바뀌지 않음).
{% if is_admin %}상태에 마우스를 올리면 마지막 연결 테스트 시각과 최근 오류를 볼 수 있습니다.{% endif %}
</p>
</div>
{# 보기 설정(2026-10-19) — 모듈 권한자 누구나, 이 브라우저에만 #}
<div class="erp-card perf-card" id="perf-view-opts">
<div class="perf-card-head">
<h2 class="perf-h">보기 설정</h2>
<span class="perf-muted">매출 실적·광고비 화면을 보는 방식입니다. 이 브라우저에만 적용되며 고르면 바로 저장됩니다.</span>
</div>
{# 표 열 너비(2026-10-27, 쿠키 perf_colw) — 매출 실적·광고비 일자별 표. 수동 = 머리글 오른쪽 경계 드래그, 너비는 이 브라우저 localStorage(perf_colw_sales/ads) #}
<div class="perf-opt-row">
<span class="perf-opt-label">표 열 너비</span>
<div class="perf-quick" role="radiogroup" aria-label="표 열 너비">
{% for k, label in [('auto', '자동(글자 길이)'), ('manual', '수동 조절')] %}
<button type="button" class="perf-seg{% if colw == k %} is-active{% endif %}" role="radio"
aria-checked="{{ 'true' if colw == k else 'false' }}" data-colw="{{ k }}">{{ label }}</button>
{% endfor %}
</div>
<span class="perf-muted" id="perf-colw-help">{% if colw == 'manual' %}매출 실적·광고비 표 머리글의 오른쪽 경계를 끌어 너비를 바꿉니다(두 번 누르면 그 열만 자동 너비). 바꾼 너비는 계속 유지됩니다.{% else %}열 너비가 글자 길이에 맞춰 자동으로 정해집니다.{% endif %}</span>
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm" id="perf-colw-reset"{% if colw != 'manual' %} hidden{% endif %}>조절한 너비 초기화</button>
</div>
</div>
{% if is_admin %}
{# 공통 보기 설정(2026-11-02, 관리자, 마이그레이션 011 perf_settings) — 매출 단위·열 숨기기, 모든 사용자에게 적용 #}
<div class="erp-card perf-card" id="perf-shared-view">
<div class="perf-card-head">
<h2 class="perf-h">공통 보기 설정</h2>
<span class="perf-muted">모든 사용자의 매출 실적 화면에 적용됩니다. 고르면 바로 저장됩니다.</span>
</div>
<div class="perf-opt-row">
<span class="perf-opt-label">매출 단위</span>
<div class="perf-quick" role="radiogroup" aria-label="매출 단위">
{% for k, label in [('won', '원'), ('thousand', '천원'), ('million', '백만원')] %}
<button type="button" class="perf-seg{% if unit == k %} is-active{% endif %}" role="radio"
aria-checked="{{ 'true' if unit == k else 'false' }}" data-unit="{{ k }}">{{ label }}</button>
{% endfor %}
</div>
<span class="perf-muted" id="perf-unit-example">예: 2,475,300원 →
{% if unit == 'thousand' %}2,475{% elif unit == 'million' %}2.5{% else %}2,475,300{% endif %}</span>
</div>
<div class="perf-opt-row">
<span class="perf-opt-label">숨길 쇼핑몰</span>
<div class="perf-hide-list">
{% for m in hide_options %}
<label class="perf-check"><input type="checkbox" data-hide="{{ m.code }}"{% if m.code in hidden_codes %} checked{% endif %} /> {{ m.name }}</label>
{% endfor %}
</div>
<span class="perf-muted">체크한 쇼핑몰은 일자별 표에서 열만 숨겨집니다. 일 합계·그래프·누적 금액은 그대로입니다.</span>
</div>
</div>
{% endif %}
{% if is_admin and auto_sync_settings %}
{# 자동 업데이트 일정(2026-10-26, 마이그레이션 011 perf_settings) — 매출 실적·광고비 따로: 사용·요일·시작/끝 시각(5분 단위)·간격(5분 단위,
기본 30분). [저장] = PUT /api/auto-sync-schedule, 스레드(auto_sync.py)가 1분 안에 반영. #}
{% set au = auto_sync_settings %}
{% macro time_select(part, value, label) -%}
{%- set hh, mm = value.split(':') -%}
<select class="erp-input perf-auto-time" data-t="{{ part }}-h" aria-label="{{ label }} 시">
{%- for h in range(24) %}<option value="{{ '%02d' % h }}"{% if '%02d' % h == hh %} selected{% endif %}>{{ '%02d' % h }}시</option>{% endfor -%}
</select><select class="erp-input perf-auto-time" data-t="{{ part }}-m" aria-label="{{ label }} 분">
{%- for m in range(0, 60, au.step) %}<option value="{{ '%02d' % m }}"{% if '%02d' % m == mm %} selected{% endif %}>{{ '%02d' % m }}분</option>{% endfor -%}
</select>
{%- endmacro %}
<div class="erp-card perf-card" id="perf-auto-sync">
<div class="perf-card-head">
<h2 class="perf-h">자동 업데이트</h2>
<span class="perf-muted">매출 실적·광고비를 고른 요일의 시작 ~ 끝 시각 사이에 정한 간격으로 자동으로 가져옵니다(오늘 포함 최근 {{ au.days }}일).
시각·간격은 {{ au.step }}분 단위이며, 저장하면 1분 안에 적용됩니다.</span>
</div>
{% if not au.env_on %}<div class="perf-notice is-warn">서버 환경변수 PERFORMANCE_AUTO_SYNC=false 로 자동 업데이트가 꺼져 있습니다 — 일정은 저장되지만 돌지 않습니다.</div>{% endif %}
{% if not au.ready %}<div class="perf-notice is-warn">일정 저장 표가 아직 없습니다. performance_db 마이그레이션 011
(scripts/sql/performance_db_011_settings.sql)을 적용해야 저장할 수 있습니다. 지금은 기본 일정(아래)으로 돕니다.</div>{% endif %}
{% if au.error %}<div class="perf-notice is-warn">{{ au.error }}</div>{% endif %}
<div class="perf-auto-rows">
{% for k in au.kinds %}{% set sc = k.schedule %}
<div class="perf-auto-row{% if not sc.enabled %} is-off{% endif %}" data-kind="{{ k.kind }}">
<div class="perf-auto-name">
<b>{{ k.name }}</b>
<label class="perf-auto-on"><input type="checkbox" data-f="enabled"{% if sc.enabled %} checked{% endif %} /> 사용</label>
</div>
<div class="perf-auto-fields">
<div class="perf-auto-field"><span class="perf-opt-label">요일</span>
<span class="perf-auto-days">
{%- for w in au.weekdays %}<label class="perf-day{% if loop.index0 == 5 %} is-sat{% elif loop.index0 == 6 %} is-sun{% endif %}"><input type="checkbox" data-day="{{ loop.index0 }}"{% if loop.index0 in sc.days %} checked{% endif %} /><span>{{ w }}</span></label>{% endfor -%}
</span>
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" data-days="all">매일</button>
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" data-days="weekday">평일</button>
</div>
<div class="perf-auto-field"><span class="perf-opt-label">시간</span>
{{ time_select('start', sc.start, k.name ~ ' 시작') }}<span class="perf-muted">부터</span>
{{ time_select('end', sc.end, k.name ~ ' 끝') }}<span class="perf-muted">까지</span>
</div>
<div class="perf-auto-field"><span class="perf-opt-label">간격</span>
<input class="erp-input perf-auto-interval" type="number" min="{{ au.step }}" max="{{ au.max }}" step="{{ au.step }}"
data-f="interval" value="{{ sc.interval }}" aria-label="{{ k.name }} 간격(분)" /><span class="perf-muted">분마다</span>
</div>
</div>
<div class="perf-muted perf-auto-next" data-next>{{ k.label }}{% if k.next_at %} · 다음 {{ k.next_at[5:16] | replace('T', ' ') }}{% endif %}</div>
</div>
{% endfor %}
</div>
<div class="perf-auto-actions">
<button type="button" class="erp-btn erp-btn-primary" id="perf-auto-save">저장</button>
<span class="perf-muted" id="perf-auto-msg" role="status"></span>
</div>
</div>
{% endif %}
{% if is_admin %}
{# 광고 API 연동(2026-10-15, 마이그레이션 007) — 구글 광고·메타 광고(2026-10-16). 인증정보는 쇼핑몰과 같은 마스터 키로 암호화 저장.
가져온 광고비·ROAS 는 광고비 탭(초록 숫자). [설정]·[연결 테스트]는 쇼핑몰 표와 같은 창(/api/ad-sources/…). #}
<div class="erp-card perf-card" id="perf-ad-sources">
<div class="perf-card-head">
<h2 class="perf-h">광고 API 연동</h2>
<span class="perf-muted">광고비 탭의 광고비·ROAS 를 광고 API 로 가져옵니다. 틱톡은 틱톡 탭에서만 보입니다(매출 실적·광고비 탭 합계 제외). 인증정보는 [설정]에서 입력하면 암호화해 저장합니다.
설정이 끝나면 광고비 탭 [광고비 업데이트]와 광고비 자동 업데이트(위 "자동 업데이트" 일정) 때 가져옵니다.</span>
</div>
{% if not ad_api_ready %}
<div class="perf-notice is-warn">광고 API 인증정보 저장 표가 아직 없습니다. performance_db 마이그레이션 007
(scripts/sql/performance_db_007_ad_api.sql)을 적용해야 저장할 수 있습니다.</div>
{% endif %}
<div class="erp-table-wrap">
<table class="perf-table perf-set-table">
<thead>
<tr><th class="perf-th-label">광고</th><th>API 설정</th><th>연결 상태</th><th>마지막 가져오기</th><th></th></tr>
</thead>
<tbody>
{% for a in ad_sources %}
<tr data-code="{{ a.code }}" data-name="{{ a.name }}" data-api="ad-sources">
<th class="perf-td-label" scope="row">{{ a.name }}</th>
<td>{% if a.configured %}<span class="perf-pill is-ok">설정완료</span>{% else %}<span class="perf-pill">미설정</span>{% endif %}</td>
<td>
<span class="perf-status st-{{ a.status }}"
title="마지막 연결 테스트: {{ when(a.last_test_at) }}{% if a.last_error %}&#10;최근 오류({{ when(a.last_error_at) }}): {{ a.last_error }}{% endif %}">
<i></i>{{ a.status_label }}</span>
{% if a.last_error and a.status not in ('ok',) %}<div class="perf-err">{{ a.last_error }}</div>{% endif %}
</td>
<td class="perf-muted perf-nowrap" title="마지막 시도: {{ when(a.last_sync_at) }}">{{ when(a.last_success_sync_at) }}</td>
<td class="perf-nowrap">
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" data-act="creds">설정</button>
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" data-act="test">연결 테스트</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<p class="perf-foot perf-muted">
구글 광고: 광고비 = 구글 광고 화면의 "비용" + 부가세 10%(부가세 포함), ROAS = 전환 가치 ÷ 비용(구글 화면 값 그대로). 날짜는 광고 계정 시간대 기준이며 원화(KRW) 계정만 가져옵니다.<br>
메타 광고: 광고비 = 광고 관리자의 "지출 금액" 그대로(메타 금액은 이미 부가세 포함), ROAS = 구매 전환값 ÷ 지출 금액(광고 관리자 "구매 ROAS"). 광고 계정이 여러 개면 날짜별로 합칩니다. 날짜는 광고 계정 시간대 기준이며, 달러 등 외화 계정은 그날 환율로 원화로 바꿔 넣습니다(중앙은행 고시 환율 종합, 그날 값이 없으면 직전 값).
가져온 날은 직접 입력·업로드 값보다 우선해 덮어씁니다.
</p>
</div>
<div class="perf-grid2">
<div class="erp-card perf-card">
<div class="perf-card-head"><h2 class="perf-h">인증정보 암호화</h2></div>
<dl class="perf-dl">
<dt>마스터 키</dt>
<dd>{% if key_info.ok %}<span class="perf-pill is-ok">설정됨 · 현재 v{{ key_info.current_version }}</span>
{% set olds = key_info.versions | reject('equalto', key_info.current_version) | list %}
{% if olds %}<span class="perf-muted">(예전 키 v{{ olds | join(', v') }} 보관 중)</span>{% endif %}
{% else %}<span class="perf-pill is-bad">미설정</span>{% endif %}</dd>
<dt>저장된 항목</dt>
<dd>{% for v, n in key_versions_in_use.items() %}v{{ v }}: {{ n }}개{% if not loop.last %}, {% endif %}{% else %}<span class="perf-muted">없음</span>{% endfor %}</dd>
</dl>
{% if stale_key_rows %}
<p class="perf-notice is-warn">예전 키로 암호화된 항목이 {{ stale_key_rows }}개 있습니다.
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" id="perf-rekey">현재 키로 다시 암호화</button></p>
{% endif %}
<p class="perf-foot perf-muted">
API 인증정보(쇼핑몰·광고)는 서버에서 AES-256-GCM 으로 암호화해 DB 에 저장합니다. 마스터 키(APP_ENCRYPTION_KEY)는 DB 가 아닌
서버 환경변수에만 있으며, 키를 잃으면 저장된 인증정보를 복구할 수 없으니 별도로 안전하게 보관하세요.
</p>
</div>
<div class="erp-card perf-card">
<div class="perf-card-head"><h2 class="perf-h">과거 매출 가져오기</h2></div>
<p class="perf-muted">[매출 업데이트]는 최근 며칠만 가져옵니다. 처음 연동했거나 빠진 기간이 있으면 기간을 지정해 한 번에
가져오세요(연동된 쇼핑몰만, 최대 366일). 같은 주문은 덮어써서 여러 번 해도 중복되지 않습니다.</p>
<div class="perf-sample-form">
<input class="erp-input perf-date" type="date" id="perf-backfill-from" value="{{ default_sample_from }}" />
<span class="perf-muted">~</span>
<input class="erp-input perf-date" type="date" id="perf-backfill-to" value="{{ default_sample_to }}" />
<button type="button" class="erp-btn erp-btn-primary" id="perf-backfill">가져오기</button>
</div>
<div class="perf-notice" id="perf-backfill-result" hidden></div>
</div>
<div class="erp-card perf-card">
<div class="perf-card-head"><h2 class="perf-h">테스트 데이터</h2>
<span class="perf-muted">현재 {{ "{:,}".format(sample_count) }}건</span></div>
<p class="perf-muted">실제 API 연동 전 화면 확인용 모의 매출입니다(사용 중인 쇼핑몰 대상). 실제 데이터와 구분되어 한 번에 지울 수 있습니다.</p>
<div class="perf-sample-form">
<input class="erp-input perf-date" type="date" id="perf-sample-from" value="{{ default_sample_from }}" />
<span class="perf-muted">~</span>
<input class="erp-input perf-date" type="date" id="perf-sample-to" value="{{ default_sample_to }}" />
<button type="button" class="erp-btn erp-btn-outline" id="perf-sample-gen">생성</button>
<button type="button" class="erp-btn erp-btn-danger" id="perf-sample-del"{% if not sample_count %} disabled{% endif %}>모두 삭제</button>
</div>
</div>
</div>
{% endif %}
</section>
{% endblock %}
{% block scripts %}<script src="/static/performance.js?v=20261105a" defer></script>{% endblock %}