| # | @lang('accounting/reports/accounts/monthly-account-balance.account') | @for ($i = 1; $i <= 12; $i++)@lang('accounting/reports/accounts/monthly-account-balance.month') {{ $i }} | @endfor@lang('accounting/reports/accounts/monthly-account-balance.total') |
|---|---|---|---|
| {{ $loop->iteration }} | {{ $account->name }} | @php $months_balances = $account->statement_items ->groupBy(fn($item) => $item->parseDateToCarbon('date')->month) ->all(); $balance = 0; @endphp @for ($i = 1; $i <= 12; $i++)@if (array_key_exists($i, $months_balances)) {{ dn($months_balances[$i]->sum('amount')) }} @php $balance+= $months_balances[$i]->sum('amount'); @endphp @else {{ dn('0.000') }} @endif | @endfor{{ dn($balance) }} |