diff --git a/app/Http/Controllers/Finance/JournalEntryController.php b/app/Http/Controllers/Finance/JournalEntryController.php index 6a8859d3..3c55342e 100644 --- a/app/Http/Controllers/Finance/JournalEntryController.php +++ b/app/Http/Controllers/Finance/JournalEntryController.php @@ -77,6 +77,8 @@ public function index(Request $request): JsonResponse 'totalCount' => $entries->count(), 'totalDebit' => $entries->sum('total_debit'), 'totalCredit' => $entries->sum('total_credit'), + 'draftCount' => $entries->where('status', 'draft')->count(), + 'confirmedCount' => $entries->where('status', 'confirmed')->count(), ]; return response()->json([ @@ -172,7 +174,7 @@ public function store(Request $request): JsonResponse 'description' => $request->description, 'total_debit' => $totalDebit, 'total_credit' => $totalCredit, - 'status' => 'confirmed', + 'status' => 'draft', 'created_by_name' => auth()->user()?->name ?? '시스템', 'attachment_note' => $request->attachment_note, ]); @@ -485,7 +487,7 @@ public function storeFromBank(Request $request): JsonResponse 'description' => $request->description, 'total_debit' => $totalDebit, 'total_credit' => $totalCredit, - 'status' => 'confirmed', + 'status' => 'draft', 'source_type' => 'bank_transaction', 'source_key' => $request->source_key, 'created_by_name' => auth()->user()?->name ?? '시스템', diff --git a/resources/views/finance/journal-entries.blade.php b/resources/views/finance/journal-entries.blade.php index f0e95aaf..7affe0eb 100644 --- a/resources/views/finance/journal-entries.blade.php +++ b/resources/views/finance/journal-entries.blade.php @@ -1360,6 +1360,7 @@ className={`px-6 py-2 text-sm font-medium rounded-lg flex items-center gap-1 tra const [loading, setLoading] = useState(false); const [stats, setStats] = useState({}); const [searchTerm, setSearchTerm] = useState(''); + const [filterStatus, setFilterStatus] = useState('all'); const [dateRange, setDateRange] = useState({ start: getKoreanDate(-30), end: getKoreanDate(), @@ -1374,6 +1375,7 @@ className={`px-6 py-2 text-sm font-medium rounded-lg flex items-center gap-1 tra const params = new URLSearchParams({ start_date: dateRange.start, end_date: dateRange.end, + status: filterStatus, search: searchTerm, }); const res = await fetch(`/finance/journal-entries/list?${params}`); @@ -1420,9 +1422,14 @@ className={`px-6 py-2 text-sm font-medium rounded-lg flex items-center gap-1 tra 목록으로 -
+
전표번호: {selectedEntry.entry_no}
전표일자: {selectedEntry.entry_date}
+
상태: + + {selectedEntry.status === 'confirmed' ? '확정' : '임시저장'} + +
작성자: {selectedEntry.created_by_name || '-'}
{selectedEntry.description &&

적요: {selectedEntry.description}

} @@ -1482,7 +1489,7 @@ className="px-4 py-2 text-sm text-red-600 bg-red-50 rounded-lg hover:bg-red-100 return (
{/* 통계 카드 */} -
+
@@ -1494,19 +1501,28 @@ className="px-4 py-2 text-sm text-red-600 bg-red-50 rounded-lg hover:bg-red-100
-
+
-

차변 합계

-

{formatCurrency(stats.totalDebit)}

+

임시저장

+

{stats.draftCount || 0}건

-
+
-

대변 합계

-

{formatCurrency(stats.totalCredit)}

+

확정

+

{stats.confirmedCount || 0}건

+
+
+
+
+
+
+
+

차변 합계

+

{formatCurrency(stats.totalDebit)}

@@ -1522,6 +1538,12 @@ className="px-3 py-1.5 text-sm border border-stone-200 rounded-lg focus:ring-2 f setDateRange(prev => ({ ...prev, end: e.target.value }))} className="px-3 py-1.5 text-sm border border-stone-200 rounded-lg focus:ring-2 focus:ring-emerald-500 outline-none" />
+
setSearchTerm(e.target.value)} @@ -1555,6 +1577,7 @@ className="w-full pl-9 pr-3 py-1.5 text-sm border border-stone-200 rounded-lg fo 적요 차변합계 대변합계 + 상태 @@ -1565,6 +1588,11 @@ className="w-full pl-9 pr-3 py-1.5 text-sm border border-stone-200 rounded-lg fo {entry.description || '-'} {formatCurrency(entry.total_debit)} {formatCurrency(entry.total_credit)} + + + {entry.status === 'confirmed' ? '확정' : '임시저장'} + + ))}