feat(project): 회의록 머리 한 칸(월 계획 숫자+결정사항) · 회의록 표 구역선만 굵은 검정·나머지 회색 · 주차 목표 두 칸(유통·인플/카페24·네이버)

- 회의록 머리: 한 줄 = 월 계획 숫자 | 결정사항 제목, 아래 전체 = 결정사항(크게), 월 계획 상세 제거
- 회의록 표: 구역 처음·끝 가로선만 굵은 검정, 나머지 선 모두 회색
- 연간 목표 주차별 매출 목표 입력: 주차마다 유통·인플 / 카페24·네이버 두 칸, 머리글은 전체 목표 아래 — 마이그레이션 project_db 030(value_dist·value_mall, value=합계)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 18:15:21 +09:00
parent 897d19ca1c
commit bff71eeeba
20 changed files with 240 additions and 72 deletions
+34 -6
View File
@@ -3179,6 +3179,8 @@ def _goal_call(fn: Any, *args: Any, **kwargs: Any) -> Any:
raise HTTPException(status_code=503, detail="업무 칸(이미 있는 업무의 세부 업무로 등록)은 project_db 마이그레이션 026 적용 후 사용할 수 있습니다.")
except store.MeetingTaskMigrationNeeded:
raise HTTPException(status_code=503, detail="업무 등록 표(모두가 같이 보는 주차별 표)는 project_db 마이그레이션 025 적용 후 사용할 수 있습니다.")
except store.MeetingMigration030Needed:
raise HTTPException(status_code=503, detail="주차 목표 두 칸(유통·인플 / 카페24·네이버)은 project_db 마이그레이션 030 적용 후 사용할 수 있습니다.")
except store.MeetingMigration020Needed:
raise HTTPException(status_code=503, detail="새 주차·결과 글·주차별 목표는 project_db 마이그레이션 020 적용 후 사용할 수 있습니다.")
except store.GoalCellConflict as exc:
@@ -3231,12 +3233,23 @@ def goals_page(request: Request, year: int) -> HTMLResponse:
_goal_label_spans(area["rows"])
# 주차별 매출 목표(020) — 월 매출 목표 칸을 누르면 그 달 월 목표·주차별 입력 창(월 목표는 직접 입력)
week_targets = None
week_split = False
if board and st.week_targets_enabled():
saved = st.goal_week_targets(start=date(year, 1, 1), end=date(year, 12, 31))
# 기간 표기 — 11/1(일)~11/8(일), days = 그 주차 날 수
week_split = st.week_split_enabled()
parts = st.goal_week_target_parts(start=date(year, 1, 1), end=date(year, 12, 31))
def part(a: date, key: str) -> str:
p_ = parts.get(a.isoformat()) or {}
v = p_.get(key)
# 030 전에 한 칸으로 넣은 주차(두 칸 비고 합계만) — 합계를 유통·인플 칸에 미리 넣어 보여 준다
if key == "dist" and v is None and p_.get("mall") is None:
v = p_.get("total")
return _goal_label("sales", v)
# 기간 표기 — 11/1(일)~11/8(일), days = 그 주차 날 수. 두 칸(030) = dist 유통·인플 · mall 카페24·네이버
week_targets = {mo: [{"start": a.isoformat(), "n": i + 1, "days": (b - a).days + 1,
"label": f"{a.month}/{a.day}({_WEEKDAYS_KR[a.weekday()]})~{b.month}/{b.day}({_WEEKDAYS_KR[b.weekday()]})",
"value": _goal_label("sales", saved.get(a.isoformat()))}
"value": _goal_label("sales", (parts.get(a.isoformat()) or {}).get("total")),
"dist": part(a, "dist"), "mall": part(a, "mall")}
for i, (a, b) in enumerate(store.month_weeks(year, mo))] for mo in range(1, 13)}
return render_template(
request,
@@ -3266,6 +3279,7 @@ def goals_page(request: Request, year: int) -> HTMLResponse:
"this_month": this_month,
"goal_area_colors": list(store.GOAL_AREA_COLORS),
"week_targets": week_targets,
"week_split": week_split,
},
)
@@ -3279,17 +3293,31 @@ def api_set_goal_week_targets(request: Request, year: int, month: int, payload:
raw = payload.get("weeks")
if not isinstance(raw, dict) or len(raw) > 6:
raise HTTPException(status_code=400, detail="weeks 가 올바르지 않습니다.")
values = {_goal_call(store.validate_period_start, k): _goal_call(store.validate_goal_value, v) for k, v in raw.items()}
# 주차 값 = 숫자 하나(예전) 또는 {dist: 유통·인플, mall: 카페24·네이버}(030, 2026-10-19)
values: dict[date, Any] = {}
for k, v in raw.items():
d = _goal_call(store.validate_period_start, k)
if isinstance(v, dict):
values[d] = (_goal_call(store.validate_goal_value, v.get("dist")), _goal_call(store.validate_goal_value, v.get("mall")))
else:
values[d] = _goal_call(store.validate_goal_value, v)
def tot(v: Any) -> float | None:
if isinstance(v, tuple):
return None if v[0] is None and v[1] is None else (v[0] or 0) + (v[1] or 0)
return v
if "month" in payload:
month_value = _goal_call(store.validate_goal_value, payload.get("month"))
else:
filled = [v for v in values.values() if v is not None]
filled = [tot(v) for v in values.values() if tot(v) is not None]
month_value = sum(filled) if filled else None
week_total = _goal_call(st.set_goal_week_targets, year=year, month=month, values=values,
month_value=month_value, updated_by=user["email"])
return JSONResponse({"ok": True, "value": month_value, "label": _goal_label("sales", month_value),
"week_total": week_total,
"weeks": {k.isoformat(): _goal_label("sales", v) for k, v in values.items()}})
"weeks": {k.isoformat(): _goal_label("sales", tot(v)) for k, v in values.items()},
"parts": {k.isoformat(): {"dist": _goal_label("sales", v[0]), "mall": _goal_label("sales", v[1])}
for k, v in values.items() if isinstance(v, tuple)}})
@router.post("/api/goals/years")