feat(실적): 매출 KPI 전년 같은 기간 대비 · 광고비 카톡 플친 열

- 매출 실적 KPI 줄에 전월 대비 옆 "전년 같은 기간 대비" % (연 보기 제외)
- 광고비 탭 카톡 플친(kakao_pf) 열 — 직접 입력, ROAS 없음
- 매출 탭 카페24 칸 광고비 줄에 구글·메타 다음 카톡 플친

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 11:34:56 +09:00
parent 78d2e665ee
commit 91fd454b2c
8 changed files with 63 additions and 9 deletions
@@ -160,6 +160,11 @@ def test_periods():
# 진행 중인 달 — 전월 같은 날까지(말일 넘지 않게)
s, e, _ = calc.resolve_period("month", date(2026, 3, 31)).compare_range(today=date(2026, 3, 31))
assert (s, e) == (date(2026, 2, 1), date(2026, 2, 28))
# 전년 같은 기간 — 진행 중이면 오늘까지, 2/29 → 2/28
s, e, label = calc.resolve_period("month", date(2026, 11, 16)).yoy_range(today=date(2026, 11, 16))
assert (s, e, label) == (date(2025, 11, 1), date(2025, 11, 16), "전년 같은 기간")
s, e, _ = calc.resolve_period("month", date(2028, 2, 10)).yoy_range(today=date(2028, 3, 5))
assert (s, e) == (date(2027, 2, 1), date(2027, 2, 28))
assert calc.pct_change(110, 100) == 10.0 and calc.pct_change(5, 0) is None and calc.pct_change(0, 0) is None