feat:계좌 입출금내역 D-2월, D-3월, D-4월 기간 버튼 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-06 12:44:58 +09:00
parent a105553cf4
commit 70dc357963

View File

@@ -1193,6 +1193,7 @@ className="px-4 py-2 bg-emerald-600 text-white rounded-lg hover:bg-emerald-700 t
onDateToChange,
onThisMonth,
onLastMonth,
onMonthOffset,
onSearch,
totalCount,
accountCodes,
@@ -1254,6 +1255,24 @@ className="px-3 py-1.5 text-sm bg-stone-100 text-stone-600 rounded-lg hover:bg-s
>
지난달
</button>
<button
onClick={() => onMonthOffset(-2)}
className="px-3 py-1.5 text-sm bg-stone-100 text-stone-600 rounded-lg hover:bg-stone-200 transition-colors font-medium"
>
D-2
</button>
<button
onClick={() => onMonthOffset(-3)}
className="px-3 py-1.5 text-sm bg-stone-100 text-stone-600 rounded-lg hover:bg-stone-200 transition-colors font-medium"
>
D-3
</button>
<button
onClick={() => onMonthOffset(-4)}
className="px-3 py-1.5 text-sm bg-stone-100 text-stone-600 rounded-lg hover:bg-stone-200 transition-colors font-medium"
>
D-4
</button>
<button
onClick={onSearch}
className="px-4 py-1.5 text-sm bg-emerald-600 text-white rounded-lg hover:bg-emerald-700 transition-colors font-medium flex items-center gap-2"
@@ -1708,6 +1727,13 @@ className="p-1 text-red-500 hover:bg-red-50 rounded transition-colors"
setDateTo(dates.to);
};
// N개월 전 버튼
const handleMonthOffset = (offset) => {
const dates = getMonthDates(offset);
setDateFrom(dates.from);
setDateTo(dates.to);
};
const formatCurrency = (val) => new Intl.NumberFormat('ko-KR').format(val || 0) + '원';
return (
@@ -1799,6 +1825,7 @@ className="p-1 text-red-500 hover:bg-red-50 rounded transition-colors"
onDateToChange={setDateTo}
onThisMonth={handleThisMonth}
onLastMonth={handleLastMonth}
onMonthOffset={handleMonthOffset}
onSearch={() => loadTransactions()}
totalCount={summary.count || logs.length}
accountCodes={accountCodes}