diff --git a/app/Http/Controllers/Finance/FinanceDashboardController.php b/app/Http/Controllers/Finance/FinanceDashboardController.php new file mode 100644 index 00000000..8eb2b34d --- /dev/null +++ b/app/Http/Controllers/Finance/FinanceDashboardController.php @@ -0,0 +1,64 @@ +bankAccountService->getSummary(); + + // 자금 일정 요약 + $scheduleSummary = $this->fundScheduleService->getSummary(); + + // 이번 달 자금 일정 요약 + $monthlySummary = $this->fundScheduleService->getMonthlySummary( + now()->year, + now()->month + ); + + // 향후 7일 자금 일정 + $upcomingSchedules = $this->fundScheduleService->getUpcomingSchedules(7); + + // 최근 거래내역 (10건) + $recentTransactions = BankTransaction::with('bankAccount:id,bank_name,account_number') + ->latest('transaction_date') + ->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' + )); + } +} diff --git a/resources/views/finance/dashboard.blade.php b/resources/views/finance/dashboard.blade.php new file mode 100644 index 00000000..067e0328 --- /dev/null +++ b/resources/views/finance/dashboard.blade.php @@ -0,0 +1,302 @@ +@extends('layouts.app') + +@section('title', '재무 대시보드') + +@section('content') +
{{ now()->format('Y년 n월 j일') }} 현재
+총 잔액
+{{ number_format($accountSummary['total_balance']) }}원
+{{ $accountSummary['total_accounts'] }}개 계좌
+예정 수입
++{{ number_format($scheduleSummary['pending_income']) }}원
+이번 달 예정
+예정 지출
+-{{ number_format($scheduleSummary['pending_expense']) }}원
+이번 달 예정
+7일내 일정
+{{ $scheduleSummary['upcoming_7days'] }}건
+처리 필요
+수입
++{{ number_format($monthlySummary['income']['total']) }}원
++ 완료: {{ number_format($monthlySummary['income']['completed']) }}원 / + 예정: {{ number_format($monthlySummary['income']['pending']) }}원 +
+지출
+-{{ number_format($monthlySummary['expense']['total']) }}원
++ 완료: {{ number_format($monthlySummary['expense']['completed']) }}원 / + 예정: {{ number_format($monthlySummary['expense']['pending']) }}원 +
+순수익
++ {{ $monthlySummary['net'] >= 0 ? '+' : '' }}{{ number_format($monthlySummary['net']) }}원 +
+총 {{ $monthlySummary['total_count'] }}건 일정
++ {{ $account->account_name ?: $account->bank_name }} +
+{{ $account->account_number }}
+{{ number_format($account->balance) }}원
+{{ $account->account_type }}
+{{ $schedule->title }}
++ {{ $schedule->scheduled_date->format('m/d') }} + @if($schedule->counterparty) + - {{ $schedule->counterparty }} + @endif +
++ {{ $schedule->schedule_type === 'income' ? '+' : '-' }}{{ number_format($schedule->amount) }}원 +
+ + {{ $schedule->status === 'pending' ? '대기' : ($schedule->status === 'completed' ? '완료' : '취소') }} + +| 날짜 | +계좌 | +유형 | +적요 | +금액 | +잔액 | +
|---|---|---|---|---|---|
| + {{ $tx->transaction_date->format('m/d') }} + | ++ {{ $tx->bankAccount?->bank_name ?? '-' }} + | ++ @php + $typeColors = [ + 'deposit' => 'bg-green-100 text-green-700', + 'withdrawal' => 'bg-red-100 text-red-700', + 'transfer' => 'bg-blue-100 text-blue-700', + ]; + $typeLabels = [ + 'deposit' => '입금', + 'withdrawal' => '출금', + 'transfer' => '이체', + ]; + @endphp + + {{ $typeLabels[$tx->transaction_type] ?? $tx->transaction_type }} + + | ++ {{ Str::limit($tx->description, 20) }} + | ++ {{ $tx->transaction_type === 'deposit' ? '+' : '-' }}{{ number_format($tx->amount) }}원 + | ++ {{ number_format($tx->balance_after) }}원 + | +
| + 거래내역이 없습니다. + | +|||||
{{ $bank->bank_name }}
+{{ number_format($bank->total_balance) }}원
+{{ $bank->count }}개 계좌
+