diff --git a/src/components/accounting/GeneralJournalEntry/ManualJournalEntryModal.tsx b/src/components/accounting/GeneralJournalEntry/ManualJournalEntryModal.tsx index bfb15412..ffded344 100644 --- a/src/components/accounting/GeneralJournalEntry/ManualJournalEntryModal.tsx +++ b/src/components/accounting/GeneralJournalEntry/ManualJournalEntryModal.tsx @@ -78,6 +78,7 @@ export function ManualJournalEntryModal({ const [journalDate, setJournalDate] = useState(() => getTodayString()); const [journalNumber, setJournalNumber] = useState('자동생성'); const [description, setDescription] = useState(''); + const [receiptNo, setReceiptNo] = useState(''); // 분개 행 const [rows, setRows] = useState([createEmptyRow()]); @@ -93,6 +94,7 @@ export function ManualJournalEntryModal({ setJournalDate(getTodayString()); setJournalNumber('자동생성'); setDescription(''); + setReceiptNo(''); setRows([createEmptyRow()]); getVendorList().then((vendorsRes) => { @@ -172,6 +174,7 @@ export function ManualJournalEntryModal({ const result = await createManualJournal({ journalDate, description, + receiptNo: receiptNo || undefined, rows, }); if (result.success) { @@ -186,7 +189,7 @@ export function ManualJournalEntryModal({ } finally { setIsSubmitting(false); } - }, [journalDate, description, rows, totals, onOpenChange, onSuccess]); + }, [journalDate, description, receiptNo, rows, totals, onOpenChange, onSuccess]); return ( @@ -197,7 +200,7 @@ export function ManualJournalEntryModal({ {/* 거래 정보 */} -
+
{/* 분개 내역 헤더 */} diff --git a/src/components/accounting/GeneralJournalEntry/actions.ts b/src/components/accounting/GeneralJournalEntry/actions.ts index 5e486062..92ad2353 100644 --- a/src/components/accounting/GeneralJournalEntry/actions.ts +++ b/src/components/accounting/GeneralJournalEntry/actions.ts @@ -62,6 +62,7 @@ export async function getJournalSummary(params: { export async function createManualJournal(data: { journalDate: string; description: string; + receiptNo?: string; rows: JournalEntryRow[]; }): Promise { return executeServerAction({ @@ -70,6 +71,7 @@ export async function createManualJournal(data: { body: { journal_date: data.journalDate, description: data.description, + receipt_no: data.receiptNo || null, rows: data.rows.map((r) => ({ side: r.side, account_subject_id: r.accountSubjectId, diff --git a/src/components/material/ReceivingManagement/ReceivingDetail.tsx b/src/components/material/ReceivingManagement/ReceivingDetail.tsx index 32523ebd..e8f51812 100644 --- a/src/components/material/ReceivingManagement/ReceivingDetail.tsx +++ b/src/components/material/ReceivingManagement/ReceivingDetail.tsx @@ -224,9 +224,7 @@ export function ReceivingDetail({ id, mode = 'view' }: Props) { if (templateCheck.success) { setHasInspectionTemplate(templateCheck.hasTemplate); } - if (templateCheck.attachments && templateCheck.attachments.length > 0) { - setInspectionAttachments(templateCheck.attachments); - } + setInspectionAttachments(templateCheck.attachments ?? []); } else { setHasInspectionTemplate(false); }