diff --git a/app/Http/Controllers/Finance/JournalEntryController.php b/app/Http/Controllers/Finance/JournalEntryController.php index fc672a83..d3e73c8a 100644 --- a/app/Http/Controllers/Finance/JournalEntryController.php +++ b/app/Http/Controllers/Finance/JournalEntryController.php @@ -239,11 +239,13 @@ public function update(Request $request, int $id): JsonResponse $tenantId = session('selected_tenant_id', 1); $entry = JournalEntry::forTenant($tenantId)->findOrFail($id); - // 출처 연결 전표는 수정 불가 (카드/은행/홈택스 등) - if ($entry->source_type && $entry->source_type !== 'manual') { + // 출처 연결 전표 수정 제한 (카드/홈택스는 원본에서 수정, 계좌는 허용) + if ($entry->source_type && ! in_array($entry->source_type, ['manual', 'bank_transaction'])) { + $sourceLabel = $entry->source_type === 'ecard_transaction' ? '카드사용내역' : '홈택스 매출/매입'; + return response()->json([ 'success' => false, - 'message' => '카드/은행/홈택스 출처 전표는 직접 수정할 수 없습니다. 원본 거래에서 분개를 수정해주세요.', + 'message' => "이 전표는 {$sourceLabel}에서 수정해주세요.", ], 403); } diff --git a/resources/views/finance/journal-entries.blade.php b/resources/views/finance/journal-entries.blade.php index d7be73be..9326cd69 100644 --- a/resources/views/finance/journal-entries.blade.php +++ b/resources/views/finance/journal-entries.blade.php @@ -1330,10 +1330,15 @@ className={`px-2.5 py-1 text-xs rounded-full font-medium transition-colors ${vie className="px-2.5 py-1 text-xs font-medium bg-amber-100 text-amber-700 rounded-full hover:bg-amber-200 transition-colors"> 분개 - ) : (row.type === 'bank' || row.type === 'card') && row.hasJournal ? ( - + ) : row.type === 'card' && row.hasJournal ? ( + + ) : row.type === 'bank' && row.hasJournal ? ( + ) : row.type === 'manual' && row.hasJournal ? (