Month Dashboard {{-- Monthly Report Search --}}
@csrf
{{-- --}}
{{-- --}}
Year Month Refresh
@php @endphp

{{ date('F', mktime(0, 0, 0, $currentMonth, 1)) }} Net Income

Needs Wants Savings
Total Income {{ $thisMonthIncome->sum('amount') }} @php $needs = $thisMonthIncome->sum('amount') * 0.5; @endphp {{ $needs }} @php $wants = $thisMonthIncome->sum('amount') * 0.3; @endphp {{ $wants }} @php $savings = $thisMonthIncome->sum('amount') * 0.2; @endphp {{ $savings }}
Total Expense {{ $thisMonthExpense->sum('totalExpense') }} {{ $thisMonthneeds }} {{ $thisMonthwants }} {{ $thisMonthsavings }}
Net Income {{ $thisMonthIncome->sum('amount') - $thisMonthExpense->sum('totalExpense') }} {{ $needs - $thisMonthneeds }} {{ $wants - $thisMonthwants }} {{ $savings - $thisMonthsavings }}

{{ $currentYear }} Net Income

Total Income Total Expense
{{ $thisYearIncome->sum('amount') }} {{ $thisYearExpense->sum('totalExpenseYear') }}
Net Income: {{ $thisYearIncome->sum('amount') - $thisYearExpense->sum('totalExpenseYear') }}

Category ways Monthly Income

@foreach ($thisMonthIncome as $item) @endforeach
Date Name Amount
{{ $item->date }} {{ $item->name }} {{ $item->amount }}
Total Income: {{ $thisMonthIncome->sum('amount') }}

Category ways Monthly Expense

@foreach ($thisMonthExpense as $item) @endforeach
Category Amount
@php $category = App\Models\Category::find($item->category_id); @endphp {{ $category->name }} {{ $item->totalExpense }}
Total Expense: {{ $thisMonthExpense->sum('totalExpense') }}
{{--

{{ date('Y') }} Monthly Income

@foreach ($thisYearIncome as $item) @endforeach
Date Name Amount
{{ $item->date }} {{ $item->name }} {{ $item->amount }}
Total Income: {{ $thisYearIncome->sum('amount') }}
--}}

{{ date('F', mktime(0, 0, 0, $currentMonth, 1)) }}, {{ $currentYear }} Monthly Income

@foreach ($thisYearIncomecategory as $item) @endforeach
Name Amount
@php $category = App\Models\Category::find($item->category_id); @endphp {{ $category->name }} {{ $item->totalIncomeYear }}
Total Income: {{ $thisYearIncomecategory->sum('totalIncomeYear') }}

{{ $currentYear }} Monthly Expense

@foreach ($thisYearExpense as $item) @endforeach
Name Amount
@php $category = App\Models\Category::find($item->category_id); @endphp {{ $category->name }} {{ $item->totalExpenseYear }}
Total Expense: {{ $thisYearExpense->sum('totalExpenseYear') }}
{{-- --}}