收入統計報表

{{-- 篩選器 --}}
{{-- 總計 --}}

{{ $year }}年{{ $month ? $month . '月' : '' }}收入總計

總收入金額
NT$ {{ number_format($total['amount'], 2) }}
收入筆數
{{ number_format($total['count']) }} 筆
{{-- 依收入類型統計 --}}

依收入類型統計

@if ($byType->count() > 0)
@foreach ($byType as $item) @endforeach
類型 筆數 金額
{{ \App\Models\Income::getIncomeTypeLabel($item->income_type) }} {{ number_format($item->count) }} NT$ {{ number_format($item->total_amount, 2) }}
@else

此期間無收入資料

@endif
{{-- 依會計科目統計 --}}

依會計科目統計

@if ($byAccount->count() > 0)
@foreach ($byAccount as $item) @endforeach
科目 筆數 金額
@if ($item->chartOfAccount) {{ $item->chartOfAccount->account_code }} - {{ $item->chartOfAccount->account_name_zh }} @else 未分類 @endif {{ number_format($item->count) }} NT$ {{ number_format($item->total_amount, 2) }}
@else

此期間無收入資料

@endif
{{-- 依月份統計 --}} @if (!$month)

{{ $year }}年月度收入趨勢

@if ($byMonth->count() > 0)
@php $maxAmount = $byMonth->max('total_amount') ?: 1; @endphp @for ($m = 1; $m <= 12; $m++) @php $monthData = $byMonth->firstWhere('month', $m); $amount = $monthData->total_amount ?? 0; $count = $monthData->count ?? 0; $percentage = ($amount / $maxAmount) * 100; @endphp @endfor
月份 筆數 金額 圖示
{{ $m }}月 {{ number_format($count) }} NT$ {{ number_format($amount, 2) }}
@else

此年度無收入資料

@endif
@endif {{-- 返回按鈕 --}}