bankAccountService->getSummary(); // 자금 일정 요약 $scheduleSummary = $this->fundScheduleService->getSummary(); // 이번 달 자금 일정 요약 $monthlySummary = $this->fundScheduleService->getMonthlySummary( now()->year, now()->month ); // 향후 7일 자금 일정 $upcomingSchedules = $this->fundScheduleService->getUpcomingSchedules(7); // 최근 거래내역 (바로빌 - 최근 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(); // 계좌별 잔액 $accountBalances = BankAccount::active() ->ordered() ->get(['id', 'bank_name', 'account_number', 'account_name', 'balance', 'account_type']); // 은행별 통계 $bankStats = $this->bankAccountService->getStatsByBank(); return view('finance.dashboard', compact( 'accountSummary', 'scheduleSummary', 'monthlySummary', 'upcomingSchedules', 'recentTransactions', 'accountBalances', 'bankStats' )); } }