refactor(WEB): 회계/차량/결재 등 코드 중복 제거 및 공통 훅 추출

- useAccountingListPage, useDateRange 공통 훅 추출
- accounting/shared/ 공통 컴포넌트 분리
- 회계 모듈(입금/출금/매출/매입/청구 등) 중복 로직 통합
- 차량관리 page.tsx 패턴 간소화
- 건설/결재/자재/출하/단가 등 날짜 관련 코드 공통화
- 코드 중복 제거 체크리스트 문서 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
유병철
2026-02-19 19:01:41 +09:00
parent a2c3e4c41e
commit 71352923c8
80 changed files with 833 additions and 587 deletions

View File

@@ -12,6 +12,7 @@ import {
TableRow,
} from '@/components/ui/table';
import type { ExpenseEstimateData, ExpenseEstimateItem } from './types';
import { formatNumber as formatCurrency } from '@/lib/utils/amount';
interface ExpenseEstimateFormProps {
data: ExpenseEstimateData;
@@ -22,10 +23,6 @@ interface ExpenseEstimateFormProps {
export function ExpenseEstimateForm({ data, onChange, isLoading }: ExpenseEstimateFormProps) {
const items = data.items;
const formatCurrency = (amount: number) => {
return new Intl.NumberFormat('ko-KR').format(amount);
};
const handleCheckChange = (id: string, checked: boolean) => {
const newItems = items.map((item) =>
item.id === id ? { ...item, checked } : item

View File

@@ -25,6 +25,7 @@ import {
} from '@/components/ui/table';
import type { ExpenseReportData, ExpenseReportItem } from './types';
import { CARD_OPTIONS } from './types';
import { formatNumber as formatCurrency } from '@/lib/utils/amount';
interface ExpenseReportFormProps {
data: ExpenseReportData;
@@ -71,10 +72,6 @@ export function ExpenseReportForm({ data, onChange }: ExpenseReportFormProps) {
onChange({ ...data, attachments: updatedAttachments });
};
const formatCurrency = (amount: number) => {
return new Intl.NumberFormat('ko-KR').format(amount);
};
return (
<div className="space-y-6">
{/* 지출 정보 */}