@php
use App\Models\FMS\PPACodes;
$ppaCodes = PPACodes::query()->get();
$item = $data;
@endphp
|
Account Title
|
Account code
|
GASS
|
STO
|
Higher Education
|
Advance Education
|
Research
|
Extension
|
Total
|
@php
foreach ($item as $key => $value) {
$total = 0;
@endphp
|
{{ $value['title'] }}
|
{{ $value['accountCode'] }}
|
@foreach($ppaCodes as $ppa)
@php
$index = preg_replace('/\s+/', '',$ppa->desc);
@endphp
@foreach($value['amount'] as $amountkey => $amountValue)
@if($amountkey == $index)
{{$value['amount'][$amountkey]['total']}} |
@php
$total += $value['amount'][$amountkey]['total'];
@endphp
@endif
@endforeach
@endforeach
{{$total}} |
@php
if(count($value['children']) > 0){
foreach ($value['children'] as $i => $v) {
@endphp
|
{{ $v['title'] }}
|
{{ $v['accountCode'] }}
|
@foreach($ppaCodes as $ppa)
@php
$index = preg_replace('/\s+/', '',$ppa->desc);
@endphp
@foreach($value['amount'] as $amountkey => $amountValue)
@if($amountkey == $index)
{{$value['amount'][$amountkey]['total']}} |
@php
$total += $value['amount'][$amountkey]['total'];
@endphp
@endif
@endforeach
@endforeach
{{$total}} |
@php
}}}
@endphp