diff --git a/app/Http/Controllers/Finance/FinanceDashboardController.php b/app/Http/Controllers/Finance/FinanceDashboardController.php index 8eb2b34d..2e88fbb2 100644 --- a/app/Http/Controllers/Finance/FinanceDashboardController.php +++ b/app/Http/Controllers/Finance/FinanceDashboardController.php @@ -3,8 +3,8 @@ namespace App\Http\Controllers\Finance; use App\Http\Controllers\Controller; +use App\Models\Barobill\BankTransaction as BarobillBankTransaction; use App\Models\Finance\BankAccount; -use App\Models\Finance\BankTransaction; use App\Models\Finance\FundSchedule; use App\Services\BankAccountService; use App\Services\FundScheduleService; @@ -37,9 +37,15 @@ public function index(): View // 향후 7일 자금 일정 $upcomingSchedules = $this->fundScheduleService->getUpcomingSchedules(7); - // 최근 거래내역 (10건) - $recentTransactions = BankTransaction::with('bankAccount:id,bank_name,account_number') - ->latest('transaction_date') + // 최근 거래내역 (바로빌 - 최근 7일, 최대 10건) + $tenantId = session('selected_tenant_id', 1); + $weekAgo = now()->subDays(7)->format('Ymd'); + $today = now()->format('Ymd'); + + $recentTransactions = BarobillBankTransaction::where('tenant_id', $tenantId) + ->whereBetween('trans_date', [$weekAgo, $today]) + ->orderBy('trans_date', 'desc') + ->orderBy('trans_time', 'desc') ->limit(10) ->get(); diff --git a/resources/views/finance/dashboard.blade.php b/resources/views/finance/dashboard.blade.php index 33f10f05..ed42ba4c 100644 --- a/resources/views/finance/dashboard.blade.php +++ b/resources/views/finance/dashboard.blade.php @@ -221,11 +221,11 @@ class="inline-flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-700 te - {{-- 최근 거래내역 --}} + {{-- 최근 거래내역 (바로빌) --}}