From 45a671940b04b786d6d512c9cfa0401e8929f34b Mon Sep 17 00:00:00 2001 From: king Date: Thu, 1 Oct 2026 11:58:03 +0900 Subject: [PATCH] =?UTF-8?q?feat(project):=20=EC=97=B0=EA=B0=84=20=EB=AA=A9?= =?UTF-8?q?=ED=91=9C=20=EB=A1=9C=EC=95=84=EC=8A=A4=20=EC=97=B0=EA=B0=84?= =?UTF-8?q?=C2=B7=EC=83=81=EB=B0=98=EA=B8=B0=C2=B7=ED=95=98=EB=B0=98?= =?UTF-8?q?=EA=B8=B0=20=EB=AA=A9=ED=91=9C/=EC=8B=A4=EC=A0=81=20=EA=B3=84?= =?UTF-8?q?=EC=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 기간 로아스 = 기간 매출 ÷ 기간 광고비 — 월 광고비를 매출 ÷ 로아스로 환산해 합친 매출 가중 평균 (목표는 매출 목표, 실적은 매출 실적으로), 매출이 없는 달이 섞이면 단순 평균. 말풍선에 방식·개월 수 - 화면 계산(저장 안 함), 숫자 칸을 고치면 바로 다시 계산. 캐시 버전 20261001e, 문서 갱신 Co-Authored-By: Claude Opus 5.5 --- .../templates/project/goal_meeting.html | 4 ++-- .../project/templates/project/goals.html | 15 ++++++------ .../project/templates/project/help.html | 2 +- .../project/templates/project/inbox.html | 4 ++-- .../project/templates/project/mytasks.html | 4 ++-- .../project/templates/project/project.html | 4 ++-- .../project/templates/project/trash.html | 4 ++-- app/static/project.js | 24 +++++++++++++++++++ docs/PROJECT_MODULE.md | 4 +++- 9 files changed, 46 insertions(+), 19 deletions(-) diff --git a/app/modules/project/templates/project/goal_meeting.html b/app/modules/project/templates/project/goal_meeting.html index 92b4985..aaa89c2 100644 --- a/app/modules/project/templates/project/goal_meeting.html +++ b/app/modules/project/templates/project/goal_meeting.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -232,5 +232,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/goals.html b/app/modules/project/templates/project/goals.html index 1d9e873..d65417e 100644 --- a/app/modules/project/templates/project/goals.html +++ b/app/modules/project/templates/project/goals.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -87,7 +87,7 @@ - {# ── 숫자 지표 — 연간·반기 칸은 화면에서 계산(매출 합계·달성률), 로아스는 % 단위 ── #} + {# ── 숫자 지표 — 연간·반기 칸은 화면에서 계산(매출 합계·달성률, 로아스 매출 가중 평균), 로아스는 % 단위 ── #} 매출 @@ -117,18 +117,19 @@ 로아스 목표 - + {# 로아스 연간·반기 = 월 매출로 가중한 평균(광고비 = 매출 ÷ 로아스로 환산) — project.js recompute #} + {% for h, hmonths, hm, hname in halves %} {% for mo in hmonths %}{{ num_cell("roas", "target", rm.target_label, mo) }}{% endfor %} - + {% endfor %} 실적 - + {% for h, hmonths, hm, hname in halves %} {% for mo in hmonths %}{{ num_cell("roas", "actual", rm.actual_label, mo) }}{% endfor %} - + {% endfor %} @@ -206,5 +207,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html index 36426cf..b699708 100644 --- a/app/modules/project/templates/project/help.html +++ b/app/modules/project/templates/project/help.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index 6bdc1df..43367a4 100644 --- a/app/modules/project/templates/project/inbox.html +++ b/app/modules/project/templates/project/inbox.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -104,5 +104,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html index e3bd752..dd9d862 100644 --- a/app/modules/project/templates/project/mytasks.html +++ b/app/modules/project/templates/project/mytasks.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -100,5 +100,5 @@ "today": {{ today | tojson }} } - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 6136178..bc39d97 100644 --- a/app/modules/project/templates/project/project.html +++ b/app/modules/project/templates/project/project.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + @@ -496,5 +496,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index 570adf4..1c921eb 100644 --- a/app/modules/project/templates/project/trash.html +++ b/app/modules/project/templates/project/trash.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -70,5 +70,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/static/project.js b/app/static/project.js index c99f053..5d9e455 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -8089,6 +8089,30 @@ rt.dataset.tip = tUpTo ? "실적이 있는 달의 목표 합계 대비" : ""; } }); + // 로아스 연간·반기 — 기간 로아스 = 기간 매출 ÷ 기간 광고비. 광고비를 따로 적지 않으니 월마다 매출 ÷ 로아스로 환산해 + // 합친다(매출 가중 평균). 로아스가 있는 달 중 매출(같은 목표/실적)이 없는 달이 있으면 단순 평균. + ["target", "actual"].forEach(function (kind) { + const roas = values("roas", kind), sales = kind === "target" ? tg : ac; + SUM_SCOPES.forEach(function (sc) { + const td = table.querySelector('.pj-goal-sum[data-metric="roas"][data-kind="' + kind + '"][data-scope="' + sc[0] + '"]'); + if (!td) return; + const months = []; + for (let m = sc[1]; m <= sc[2]; m++) if (roas[m] != null && roas[m] > 0) months.push(m); + if (!months.length) { td.textContent = ""; td.dataset.tip = ""; return; } + const weighted = months.every(function (m) { return sales[m] != null && sales[m] > 0; }); + let v; + if (weighted) { + let s = 0, spend = 0; + months.forEach(function (m) { s += sales[m]; spend += sales[m] / roas[m]; }); + v = s / spend; + } else { + v = months.reduce(function (a, m) { return a + roas[m]; }, 0) / months.length; + } + td.textContent = (Math.round(v * 10) / 10).toLocaleString("ko-KR") + "%"; + td.dataset.tip = (weighted ? "매출 가중 평균(월 광고비 = 매출 ÷ 로아스로 환산)" : "단순 평균(매출이 없는 달이 있어서)") + + " · " + months.length + "개월"; + }); + }); } recompute(); diff --git a/docs/PROJECT_MODULE.md b/docs/PROJECT_MODULE.md index 491f30a..b9edfa2 100644 --- a/docs/PROJECT_MODULE.md +++ b/docs/PROJECT_MODULE.md @@ -519,7 +519,9 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중 - **열 순서** — 연간 · 1~6월 · **상반기** · 7~12월 · **하반기**. 템플릿 컨텍스트 `halves` (`(반기, 월 목록, 글 칸 번호 13|14, 이름)`), 월 칸은 `pj-goal-m` + `data-h="1|2"`, 반기 칸은 `pj-goal-half-col`. - 숫자 지표: 매출 목표·실적의 반기 칸 = 그 반기 월 합계(`data-scope="13|14"`, 연간은 `0`), 달성률은 연간과 같은 규칙 - (실적이 있는 달의 목표 합계 대비, `SUM_SCOPES`). 로아스 반기·연간 칸은 계산하지 않는다(회색). + (실적이 있는 달의 목표 합계 대비, `SUM_SCOPES`). **로아스 연간·반기**(목표·실적) = 기간 매출 ÷ 기간 광고비 — 광고비를 따로 적지 않아 + 월마다 매출 ÷ 로아스로 환산해 합친 **매출 가중 평균**(같은 목표/실적 매출 사용), 로아스가 있는 달 중 매출이 없는 달이 있으면 단순 평균 + (말풍선에 방식·개월 수). 화면 계산(저장 안 함), 숫자 칸을 고치면 바로 다시 계산. - 업무 영역 글: `goal_cells.month` **13 = 상반기, 14 = 하반기**(014 가 CHECK 를 0~14 로 넓힘). 014 미적용이면 반기 글 칸은 보기 전용 빈 칸이고, 저장 API 는 503 "마이그레이션 014 필요"(`store.GoalMigration014Needed`). - **반기 접기** — 반기 칸 머리의 버튼(`.pj-goal-fold`, 펼침 ‹ / 접힘 뒤집힌 › + 강조색)이 그 반기 월 칸을 접었다 편다.