refactor(WEB): 회계/견적/설정/생산 등 전반적 코드 개선 및 공통화 2차
- 회계 모듈 전면 개선: 청구/입금/출금/매입/매출/세금계산서/일반전표/거래처원장 등 - 견적 모듈 금액 포맷/할인/수식/미리보기 등 코드 정리 - 설정 모듈: 계정관리/직급/직책/권한 상세 간소화 - 생산 모듈: 작업지시서/작업자화면/검수 문서 코드 정리 - UniversalListPage 엑셀 다운로드 및 필터 기능 확장 - 대시보드/게시판/수주 등 날짜 유틸 공통화 적용 - claudedocs 문서 인덱스 업데이트 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
import { useState, useCallback, useEffect, useMemo } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
import { Plus, Trash2, Loader2 } from 'lucide-react';
|
||||
import { formatNumber } from '@/lib/utils/amount';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
@@ -44,6 +45,7 @@ import {
|
||||
import { createManualJournal, getAccountSubjects, getVendorList } from './actions';
|
||||
import type { JournalEntryRow, JournalSide, AccountSubject, VendorOption } from './types';
|
||||
import { JOURNAL_SIDE_OPTIONS } from './types';
|
||||
import { getTodayString } from '@/lib/utils/date';
|
||||
|
||||
interface ManualJournalEntryModalProps {
|
||||
open: boolean;
|
||||
@@ -71,7 +73,7 @@ export function ManualJournalEntryModal({
|
||||
onSuccess,
|
||||
}: ManualJournalEntryModalProps) {
|
||||
// 거래 정보
|
||||
const [journalDate, setJournalDate] = useState(() => new Date().toISOString().slice(0, 10));
|
||||
const [journalDate, setJournalDate] = useState(() => getTodayString());
|
||||
const [journalNumber, setJournalNumber] = useState('자동생성');
|
||||
const [description, setDescription] = useState('');
|
||||
|
||||
@@ -87,7 +89,7 @@ export function ManualJournalEntryModal({
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
// 초기화
|
||||
setJournalDate(new Date().toISOString().slice(0, 10));
|
||||
setJournalDate(getTodayString());
|
||||
setJournalNumber('자동생성');
|
||||
setDescription('');
|
||||
setRows([createEmptyRow()]);
|
||||
@@ -361,10 +363,10 @@ export function ManualJournalEntryModal({
|
||||
합계
|
||||
</TableCell>
|
||||
<TableCell className="text-right text-sm font-bold">
|
||||
{totals.debitTotal.toLocaleString()}
|
||||
{formatNumber(totals.debitTotal)}
|
||||
</TableCell>
|
||||
<TableCell className="text-right text-sm font-bold">
|
||||
{totals.creditTotal.toLocaleString()}
|
||||
{formatNumber(totals.creditTotal)}
|
||||
</TableCell>
|
||||
<TableCell colSpan={2} />
|
||||
</TableRow>
|
||||
@@ -375,8 +377,8 @@ export function ManualJournalEntryModal({
|
||||
{/* 차대변 불일치 경고 */}
|
||||
{totals.debitTotal !== totals.creditTotal && totals.debitTotal > 0 && (
|
||||
<p className="text-xs text-red-500">
|
||||
차변 합계({totals.debitTotal.toLocaleString()})와 대변 합계(
|
||||
{totals.creditTotal.toLocaleString()})가 일치하지 않습니다.
|
||||
차변 합계({formatNumber(totals.debitTotal)})와 대변 합계(
|
||||
{formatNumber(totals.creditTotal)})가 일치하지 않습니다.
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user