@php $max=0; $report = $reports->isNotEmpty() ? $reports->first() : null; @endphp @if($action)
Department - {{$report->department}}
Category - {{$report->category}}
Employee ID - {{$report->employee_no}}
Employee Name - {{$report->name}}

@endif
{{ $companyname->v4_value }} Eclaim Report {{ $timedate }}
@foreach ($reports as $report) @php if(count($report->fields)>$max){ $max = count($report->fields); } @endphp @endforeach @foreach ($arrColumns as $key => $arrColumn) @if (!in_array($key, $columnHideShowData)) @endif @endforeach @for ($k = 0; $k < $max; $k++) @endfor @php $totalamount =0; $max=0; @endphp @foreach ($reports as $report) @php $totalamount = $totalamount + $report->total_amount; if(count($report->fields)>$max){ $max = count($report->fields); } @endphp @php $arrRows = ($action)?[date('d-m-Y', strtotime($report->date_applied)), $report->eclaimtype, $report->total_amount, date('d-m-Y', strtotime($report->billing_date)), $report->status_text,"remarks"]:[$report->employee_no, $report->name, $report->category, $report->department, date('d-m-Y', strtotime($report->date_applied)), $report->eclaimtype, $report->total_amount, date('d-m-Y', strtotime($report->billing_date)), $report->status_text,"remarks"]; @endphp @for ($k = 0; $k < count($arrRows); $k++) @if (!in_array($k, $columnHideShowData) || $action) @if ($arrRows[$k] == "remarks") @foreach ($report->fields as $field) @endforeach @else @endif @endif @endfor @endforeach @if(!$action) @else @endif @for ($k = 0; $k < $max; $k++) @endfor
{{ $arrColumn }} Desc {{ $k }}
{{ $field->value }}{{ $arrRows[$k] }}
Total Amount {{ $totalamount }}
Total Amount {{ $totalamount }}