fix: [accounting] 일반전표 수동입력 모달 개선 + 입고 상세 정리
This commit is contained in:
@@ -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<JournalEntryRow[]>([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 (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
@@ -197,7 +200,7 @@ export function ManualJournalEntryModal({
|
||||
</DialogHeader>
|
||||
|
||||
{/* 거래 정보 */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-3 gap-3 p-3 bg-muted/50 rounded-lg">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-4 gap-3 p-3 bg-muted/50 rounded-lg">
|
||||
<div>
|
||||
<Label className="text-sm font-medium">
|
||||
전표일자 <span className="text-red-500">*</span>
|
||||
@@ -222,6 +225,12 @@ export function ManualJournalEntryModal({
|
||||
onChange={setDescription}
|
||||
placeholder="적요 입력"
|
||||
/>
|
||||
<FormField
|
||||
label="증빙번호"
|
||||
value={receiptNo}
|
||||
onChange={setReceiptNo}
|
||||
placeholder="영수증/승인번호"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* 분개 내역 헤더 */}
|
||||
|
||||
@@ -62,6 +62,7 @@ export async function getJournalSummary(params: {
|
||||
export async function createManualJournal(data: {
|
||||
journalDate: string;
|
||||
description: string;
|
||||
receiptNo?: string;
|
||||
rows: JournalEntryRow[];
|
||||
}): Promise<ActionResult> {
|
||||
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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user