{% extends "erp_base.html" %} {% block head_extra %}{% endblock %} {%- macro won(v) -%} {%- if v is none -%} {%- elif v == 0 -%}– {%- else -%}{{ amt(v) }}{%- endif -%} {%- endmacro -%} {#- 큰 금액(KPI·연 누적) — 원 단위면 ₩1,234, 천원·백만원이면 1,234천원 -#} {%- macro money(v) -%} {%- if unit == 'won' -%}₩{{ amt(v) }}{%- else -%}{{ amt(v) }}{{ unit_label }}{%- endif -%} {%- endmacro -%} {#- 매출 칸 아래 광고비(ROAS%) — 광고비 화면과 같은 값·색. 카페24 = 구글·메타 두 줄(이름 붙임) -#} {%- macro adl(lines) -%} {%- for a in lines or [] -%}{% if a.label %}{{ a.label }}{% endif %}{{ amt(a.amount) }}{% if a.roas is not none %}({{ "{:,}".format(a.roas) }}%){% endif %}{%- endfor -%} {%- endmacro -%} {#- 일 합계 광고비(ROAS%) — ROAS = 일 합계 금액 ÷ 일 합계 광고비. 수수료 차감 매출 보기면 차감 매출 기준, 그 밖엔 총매출 기준 -#} {%- macro adl_total(a) -%} {%- for key, cls in (("roas", "for-gross"), ("roas_net", "for-net")) -%} {%- set rs = a[key] -%} {{ amt(a.amount) }}{% if rs is not none %}({{ "{:,}".format(rs) }}%){% endif %} {%- endfor -%} {%- endmacro -%} {#- 한 칸에 총매출/수수료/차감매출 세 값을 넣고, 보기 전환은 CSS(data-metric)로. -#} {%- macro m3(m) -%} {{ won(m.gross) }}{{ won(m.commission) }}{{ won(m.net) }} {%- endmacro -%} {% block content %}
{% include "performance/_tabs.html" %}
{% for q in nav.quick %} {{ q.label }} {% endfor %}
~ {% for c in codes %}{% if not selected_all %}{% endif %}{% endfor %}
쇼핑몰: {% if selected_all %}전체{% else %}{{ codes | length }}곳{% endif %}
{% if period_kind == 'custom' %} {% else %} {% endif %} {% for c in all_codes %} {% endfor %}
마지막 업데이트 {{ (last_update_at or '')[:16] | replace('T', ' ') or '—' }} {% if auto_sync %} {# 다음 자동 업데이트까지 남은 시간 — 초 단위로 실시간(performance.js initNextUpdate, 2026-10-19) #} 다음 업데이트까지 — {% endif %} {# 업데이트 중에도 누를 수 있다 — 진행 중인 업데이트(수동·자동)의 진행 창을 다시 연다(2026-10-19) #}
{% if no_marketplaces %}
매출에 포함된 쇼핑몰이 없습니다. {% if is_admin %}실적 설정에서 쇼핑몰 사용을 켜세요.{% endif %}
{% endif %} {% if problems %}
연결 오류 {% for p in problems %}{{ p.name }} · {{ p.label }}{% endfor %} — 해당 쇼핑몰은 마지막 정상 수집분까지만 반영됩니다. 나머지는 정상입니다.
{% endif %} {% for k in kpis %}
{{ money(k.value) }} {% if k.delta is none %}{{ k.cmp }} 비교 없음 {% else %} {% if k.delta > 0 %}▲{% elif k.delta < 0 %}▼{% else %}–{% endif %} {{ "%.1f" | format(k.delta | abs) }}% {{ k.cmp }} 대비 {% endif %}
{% endfor %}

{% if period_kind == 'year' %}월별 × 쇼핑몰{% else %}일자별 × 쇼핑몰{% endif %}

{% if unit != 'won' %}단위: {{ unit_label }}{% endif %} 광고비(ROAS%) {% if manual_upload_names %} {% endif %}
{#- perf-autofit(2026-10-22) = 열 너비는 내용 길이만큼, 날짜 열은 가로 스크롤해도 고정 -#} {#- 그룹(2026-10-22) — 그룹 열 = 보이는 하위 쇼핑몰 합계, ⊟/⊞ 로 하위 열 접기/펴기(이 브라우저에 기억, 펼치고 접을 때 애니메이션). 하위 열은 .perf-gc 로 내용을 감싼다 — 접을 때 그 너비를 0 으로 줄여 열이 부드럽게 닫힌다. is-glast = 그룹의 마지막 하위 열(오른쪽 묶음 선) -#} {% for col in cols %}{% set c = col.code %} {% set glast = col.kind == 'child' and (not loop.nextitem or loop.nextitem.group != col.group) %} {% if col.kind == 'group' %} {% else %}{% if col.kind == 'child' %}
{% endif %}{{ short_names[c] }}{% if c in manual_codes %} ✎{% endif %}{% if col.kind == 'child' %}
{% endif %}{% endif %} {% endfor %}
{% for r in table %} {% for col in cols %} {% set c = col.code %} {% set m = r.cells[c] %} {% set glast = col.kind == 'child' and (not loop.nextitem or loop.nextitem.group != col.group) %} {% set gattr %}{% if col.kind == 'child' %} data-group-child="{{ col.group }}"{% endif %}{% endset %} {% set gc0 %}{% if col.kind == 'child' %}
{% endif %}{% endset %}{% set gc1 %}{% if col.kind == 'child' %}
{% endif %}{% endset %} {% if col.kind == 'group' %} {% elif r.kind == 'day' and c in manual_codes %} {% set is_manual = (r.date ~ '|' ~ c) in manual_cells %} {% set fx = (formula_cells or {}).get(r.date ~ '|' ~ c) %} {% set memo = (memo_cells or {}).get(r.date ~ '|' ~ c) %}{#- 메모(010) — 우클릭 메모 삽입·수정·삭제, 있으면 칸 오른쪽 위 빨간 삼각형 -#} {% else %} {% endif %} {% endfor %} {% endfor %}
{% if period_kind == 'year' %}월{% else %}날짜{% endif %}{{ short_names[c] }}{% if period_kind == 'year' %}월 합계{% else %}일 합계{% endif %}
{{ r.label }}{% if r.holiday %}{{ r.holiday }}{% endif %} {{ m3(m) }}{{ gc0 }}{{ m3(m) }}{{ adl(r.ads[c]) }}{{ gc1 }}{{ gc0 }}{{ m3(m) }}{{ adl(r.ads[c]) }}{{ gc1 }}{{ m3(r.total) }}{% if r.ads_total %}{{ adl_total(r.ads_total) }}{% endif %}
{% if manual_codes and period_kind != 'year' %}

✎ 표시 쇼핑몰은 날짜 칸을 눌러 총매출을 직접 입력합니다 — Enter 저장 후 아래 칸, Esc 취소, 비우고 저장하면 다시 API 수집값. 1000+2000 처럼 = 없이 계산식을 넣으면 바로 계산됩니다. 파란 숫자 = 수동 입력값, 파랑 굵은 숫자 = 계산식. 수수료는 그날 수수료율로 계산되고, 입력을 마치면 합계·그래프가 다시 계산됩니다.

{% endif %}

{% if period_kind == 'year' %}월별{% else %}일별{% endif %} 매출 추이

쇼핑몰별 비중

{{ period.label }}

{{ month.label }} 쇼핑몰별 누적 실적

{% if unit != 'won' %}단위: {{ unit_label }}{% endif %}
{% for r in month.rows %} {% endfor %}
쇼핑몰총매출수수료수수료 차감 매출매출 비중
{{ names[r.code] }} {{ won(r.gross) }} {{ won(r.commission) }} {{ won(r.net) }} {% if r.share is not none %}{{ "%.1f" | format(r.share) }}%{% else %}–{% endif %}
합계 {{ won(month.total.gross) }} {{ won(month.total.commission) }} {{ won(month.total.net) }} {% if month.total.share is not none %}100%{% else %}–{% endif %}

{{ year.year }}년 누적

{% if unit != 'won' %}단위: {{ unit_label }}{% endif %}
총매출{{ money(year.total.gross) }}
수수료{{ money(year.total.commission) }}
수수료 차감 매출{{ money(year.total.net) }}
{% for r in year.rows %} {% endfor %}
월총매출수수료수수료 차감 매출
{{ r.label }} {{ won(r.gross) }} {{ won(r.commission) }} {{ won(r.net) }}
합계 {{ won(year.total.gross) }} {{ won(year.total.commission) }} {{ won(year.total.net) }}

매출 기준: 결제는 결제일, 취소·반품은 발생일에 반영(음수). 수수료는 그날 적용되는 쇼핑몰 수수료율로 계산하며 일·쇼핑몰 단위로 원 미만 반올림합니다. 금액을 누르면 주문 목록을 볼 수 있습니다.

{% endblock %} {% block scripts %}{% endblock %}