From 069d998c9d7ca53edaf3a9fa4142a0ff3b5ddaca Mon Sep 17 00:00:00 2001 From: king Date: Tue, 2 Jun 2026 18:22:58 +0900 Subject: [PATCH] =?UTF-8?q?feat(expense):=20=EA=B2=BD=EB=B9=84=20=EB=82=B4?= =?UTF-8?q?=EC=97=AD=20=EC=9B=94=20=EC=84=A0=ED=83=9D=20=ED=95=84=ED=84=B0?= =?UTF-8?q?=20+=20=EC=9B=94=20=ED=95=A9=EA=B3=84,=20=EC=9B=94=EB=B3=84=20?= =?UTF-8?q?=EC=A7=91=EA=B3=84=20=EB=B2=84=ED=8A=BC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 상단 "월별 집계" 버튼 삭제 - 경비 내역: 월 선택(input month, 변경 시 자동 조회) 기본 이번 달 - 선택 월(사용일 기준)만 표시 + 해당 월 합계금액 표시 Co-Authored-By: Claude Opus 4.8 --- app/modules/expense/router.py | 8 +++++++- app/modules/expense/templates/expense/index.html | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/modules/expense/router.py b/app/modules/expense/router.py index 9c894bb..a2a1487 100644 --- a/app/modules/expense/router.py +++ b/app/modules/expense/router.py @@ -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), diff --git a/app/modules/expense/templates/expense/index.html b/app/modules/expense/templates/expense/index.html index 962f90d..147760d 100644 --- a/app/modules/expense/templates/expense/index.html +++ b/app/modules/expense/templates/expense/index.html @@ -5,7 +5,6 @@