@foreach($months as $k => $m) @endforeach @foreach($account_types as $account_type => $account_type_detail ) @php $account_ids=[]; @endphp @foreach($accounts->where('account_primary_type', $account_type)->sortBy('name')->all() as $account) @php $total = 0; $account_ids[]=$account->id; @endphp @foreach($months as $k => $m) @php $account_budget = $budget->where('accounting_account_id', $account->id)->first(); $value = !is_null($account_budget) && !is_null($account_budget->$m) ? $account_budget->$m : null; @endphp @endforeach @endforeach @foreach($months as $k => $m) @endforeach @endforeach @foreach($months as $k => $m) @endforeach
@lang('account.account') {{Carbon::createFromFormat('m', $k)->format('M')}}@lang('sale.total')
{{$account_type_detail['label']}}
{{$account->name}} @if(!is_null($value)) {{@num_format($value)}} @php $total += $value; @endphp @endif {{@num_format($total)}}
@lang('sale.total') {{@num_format($budget->whereIn('accounting_account_id', $account_ids)->sum($m))}}
@lang('lang_v1.grand_total') {{@num_format($budget->sum($m))}}