From d77b9615b3e82dc0acfcb109d73b8214e768d61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Wed, 4 Mar 2026 12:42:35 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[journal]=20=EA=B3=84=EC=A2=8C=20?= =?UTF-8?q?=EC=B6=9C=EC=B2=98=20=EC=A0=84=ED=91=9C=20=EC=9D=BC=EB=B0=98?= =?UTF-8?q?=EC=A0=84=ED=91=9C=EC=97=90=EC=84=9C=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=ED=97=88=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 카드/세금계산서 출처 → 잠금 유지 (원본에서 수정) - 계좌(bank_transaction) 출처 → 일반전표에서 수정 허용 - 프론트엔드 UI + 백엔드 update 메서드 동시 수정 --- .../Controllers/Finance/JournalEntryController.php | 8 +++++--- resources/views/finance/journal-entries.blade.php | 14 ++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) 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 ? (