From 1c25ff9fd111170e780d4d1667b351df87bfb915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Tue, 17 Mar 2026 09:22:50 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[finance]=20=EA=B3=84=EC=A0=95=EA=B3=BC?= =?UTF-8?q?=EB=AA=A9=20=EC=84=A4=EC=A0=95=20=EB=AA=A8=EB=8B=AC=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=20=EC=BD=94=EB=93=9C=20=EC=A1=B0=ED=9A=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AccountCode 모델에 BelongsToTenant trait 추가하여 테넌트별 필터링 적용 - accountCodeStore에서 하드코딩된 tenant_id를 세션 기반으로 변경 --- app/Http/Controllers/Finance/JournalEntryController.php | 2 +- app/Models/Barobill/AccountCode.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Finance/JournalEntryController.php b/app/Http/Controllers/Finance/JournalEntryController.php index b528906d..c8cb9d2c 100644 --- a/app/Http/Controllers/Finance/JournalEntryController.php +++ b/app/Http/Controllers/Finance/JournalEntryController.php @@ -831,7 +831,7 @@ public function accountCodeStore(Request $request): JsonResponse $maxSort = AccountCode::max('sort_order') ?? 0; $accountCode = AccountCode::create([ - 'tenant_id' => 1, + 'tenant_id' => session('selected_tenant_id', 1), 'code' => $validated['code'], 'name' => $validated['name'], 'category' => $validated['category'] ?? null, diff --git a/app/Models/Barobill/AccountCode.php b/app/Models/Barobill/AccountCode.php index 47cb6843..8caf5cff 100644 --- a/app/Models/Barobill/AccountCode.php +++ b/app/Models/Barobill/AccountCode.php @@ -3,6 +3,7 @@ namespace App\Models\Barobill; use App\Models\Tenants\Tenant; +use App\Traits\BelongsToTenant; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -11,6 +12,7 @@ */ class AccountCode extends Model { + use BelongsToTenant; protected $table = 'account_codes'; protected $fillable = [