@extends('layouts.print')
@section('title', __('report.categorized_transactions'))
@section('content')
{{-- ref: https://github.com/niklasravnsborg/laravel-pdf#headers-and-footers --}}
@include('reports.partials.letterhead')
@if (isset(auth()->activeBook()->report_titles['finance_categorized']))
{{ auth()->activeBook()->report_titles['finance_categorized'] }}
@else
{{ __('report.categorized_transactions') }}
@endif
@if (request('month') != '00')
- {{ $currentMonthEndDate->isoFormat('MMMM Y') }}
@else
- {{ $currentMonthEndDate->isoFormat('Y') }}
@endif
{{ __('transaction.income') }}
@if ($groupedTransactions->has(1) && !$groupedTransactions[1]->where('category_id', null)->isEmpty())
~{{ __('transaction.no_category') }}~
@include('reports.finance._internal_content_categorized', [
'hasGroupedTransactions' => $groupedTransactions->has(1),
'transactions' => $groupedTransactions[1]->where('category_id', null),
'categoryName' => __('transaction.no_category'),
])
@endif
@foreach($incomeCategories->sortBy('id')->values() as $key => $incomeCategory)
{{-- ref: https://mpdf.github.io/paging/page-breaks.html#tables --}}
{{ $incomeCategory->name }}
@include('reports.finance._internal_content_categorized', [
'hasGroupedTransactions' => $groupedTransactions->has(1),
'transactions' => $groupedTransactions[1]->where('category_id', $incomeCategory->id),
'categoryName' => $incomeCategory->name,
])
@endforeach
{{ __('transaction.spending') }}
@if ($groupedTransactions->has(0) && !$groupedTransactions[0]->where('category_id', null)->isEmpty())
~{{ __('transaction.no_category') }}~
@include('reports.finance._internal_content_categorized', [
'hasGroupedTransactions' => $groupedTransactions->has(0),
'transactions' => $groupedTransactions[0]->where('category_id', null),
'categoryName' => __('transaction.no_category'),
])
@endif
@foreach($spendingCategories->sortBy('id')->values() as $key => $spendingCategory)
{{ $spendingCategory->name }}
@include('reports.finance._internal_content_categorized', [
'hasGroupedTransactions' => $groupedTransactions->has(0),
'transactions' => $groupedTransactions[0]->where('category_id', $spendingCategory->id),
'categoryName' => $spendingCategory->name,
])
@endforeach
@include('reports.finance._pdf_signature_content')
@if (Setting::for(auth()->activeBook())->get('has_pdf_page_number') != '0')
{{ __('report.page') }} {PAGENO}/{nb}
@endif
@endsection
@section('style')
@endsection