feat(project): month-bounded meeting weeks, weekly sales targets, sticky header

- Weeks stay inside the month: week 1 starts on the 1st (through the next
  Sunday if the 1st is a weekend); a trailing Mon/Tue joins the last week.
  "Last week" is the previous period.
- Prev-week review columns: 전주 업무 | 결과(text, new result_note) |
  전주 목표 | 결과(amount).
- Header now shows month target, cumulative weekly target, month-to-date
  sales and gap (amount + %), with decisions/notes beside it; the area
  stays fixed while scrolling.
- Goals board: the monthly sales target is entered per week; the sum
  becomes the month target.
- Migration 020: result_note, goal_week_targets, drop Monday-only check,
  move absorbed Monday meetings to the new week start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 11:24:41 +09:00
parent 9194487217
commit cd3577b299
21 changed files with 751 additions and 250 deletions
+16 -2
View File
@@ -55,13 +55,23 @@ def goals_ctx(admin: bool) -> dict:
}
def week_targets() -> dict:
"""2026년 달마다 주차(store.month_weeks) — 1월 1·2주차만 값(100·200)."""
out = {}
for mo in range(1, 13):
out[mo] = [{"start": a.isoformat(), "n": i + 1, "label": f"{a.month}/{a.day}~{b.month}/{b.day}",
"value": {(1, 0): "100", (1, 1): "200"}.get((mo, i), "")}
for i, (a, b) in enumerate(store.month_weeks(2026, mo))]
return out
def meeting_view(err: bool) -> dict:
"""회의록 2026-09-28 주 — 유통 쿠팡(쇼핑몰 연결 — 화면엔 자동 실적 없음, 정량 목표 100), 상품1(직접 입력 결과)."""
prev_cou = {"id": 901, "week_start": "2026-09-21", "content": "지난주 행사", "target_amount": 100, "result_amount": None,
"status": "", "marketplace_code": "coupang", "period": "9/21~9/27", "not_started": False,
"market_off": False, "auto_error": err, "auto_result": None if err else 80,
"result": None if err else 80, "market_name": "쿠팡"}
prev_p1 = {"id": 902, "week_start": "2026-09-21", "content": "샘플", "target_amount": 200, "result_amount": 100,
prev_p1 = {"id": 902, "week_start": "2026-09-21", "content": "샘플", "result_note": "샘플 결과", "target_amount": 200, "result_amount": 100,
"status": "partial", "marketplace_code": "", "period": "9/21~9/27", "not_started": False,
"market_off": False, "auto_error": False, "auto_result": None, "result": 100, "market_name": ""}
it_cou = {"id": 1, "section": "유통", "section_color": "", "label": "쿠팡", "content": "original",
@@ -74,7 +84,7 @@ def meeting_view(err: bool) -> dict:
it_new = {"id": 3, "section": "상품", "section_color": "#fde2e4", "label": "새 줄", "content": "",
"target_amount": None, "marketplace_code": "", "market_name": "", "market_off": False,
"market_unknown": False, "week_auto": None, "week_error": False, "prev": None, "rate": None}
meeting = {"week_start": "2026-09-28", "week_target": 1000, "attendees": "", "notes": "메모 원본", "cell_merges": True,
meeting = {"week_start": "2026-09-28", "week_target": 1000, "attendees": "", "notes": "메모 원본", "cell_merges": True, "result_notes": True,
"items": [it_p1, it_new, it_cou],
"sections": [{"name": "상품", "color": "#fde2e4", "rows": [it_p1, it_new]},
{"name": "유통", "color": "", "rows": [it_cou]}]}
@@ -82,6 +92,8 @@ def meeting_view(err: bool) -> dict:
"mtd": None if err else 0, "mtd_end": "2026-09-27", "weeks_left": 1,
"need_per_week": None if err else 10000, "prev_target": 500, "prev_exists": True,
"prev_result": None if err else 0, "week_result": None if err else 0,
"week_targets_set": True, "cum_target": 4000.0, "cum_target_won": 4000,
"gap": None if err else -4000, "rate": None if err else 0.0,
"perf": True, "perf_state": "error" if err else "ok",
"unknown": ["mtd", "prev_result", "week_result"] if err else [],
"fresh_oldest": "" if err else "10/01 14:20",
@@ -139,6 +151,8 @@ def main() -> None:
pages = {
"goals_admin.html": ("project/goals.html", goals_ctx(True)),
"goals_ro.html": ("project/goals.html", goals_ctx(False)),
# 주차별 매출 목표(020) — 매출 목표 칸이 주차 입력 창을 연다
"goals_weekly_admin.html": ("project/goals.html", goals_ctx(True) | {"week_targets": week_targets()}),
"meeting_admin.html": ("project/goal_meeting.html", meeting_ctx(True, False)),
"meeting_err.html": ("project/goal_meeting.html", meeting_ctx(True, True)),
"meeting_ro.html": ("project/goal_meeting.html", meeting_ctx(False, False, can_sync=False)),