feat(expense): 경비 내역 월 선택 필터 + 월 합계, 월별 집계 버튼 제거
- 상단 "월별 집계" 버튼 삭제 - 경비 내역: 월 선택(input month, 변경 시 자동 조회) 기본 이번 달 - 선택 월(사용일 기준)만 표시 + 해당 월 합계금액 표시 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -279,11 +279,15 @@ async def expense_index(request: Request) -> HTMLResponse:
|
||||
)
|
||||
|
||||
store = _store(request)
|
||||
items = sorted(
|
||||
all_items = sorted(
|
||||
store.list_for(user["email"]),
|
||||
key=lambda i: (i.get("spent_at", ""), i.get("created_at", "")),
|
||||
reverse=True,
|
||||
)
|
||||
# 선택한 월(사용일 기준)만 표시. 기본 = 이번 달.
|
||||
_, _, month = _parse_month(request)
|
||||
items = [it for it in all_items if str(it.get("spent_at", ""))[:7] == month]
|
||||
month_total = sum(int(i.get("amount", 0)) for i in items)
|
||||
summary = store.summary_for(user["email"])
|
||||
pending_count = 0
|
||||
is_approver = is_admin(user) or has_module(user, "expense_approver")
|
||||
@@ -300,6 +304,8 @@ async def expense_index(request: Request) -> HTMLResponse:
|
||||
"pending_count": pending_count,
|
||||
"items": items,
|
||||
"summary": summary,
|
||||
"month": month,
|
||||
"month_total": month_total,
|
||||
"categories": _categories(request),
|
||||
"methods": list(METHODS),
|
||||
"statuses": list(STATUSES),
|
||||
|
||||
Reference in New Issue
Block a user