@php $series = 0; @endphp @foreach ($data as $key => $item) @if(@$key == "Order Status") @foreach ($item as $property => $value) {{ ucfirst(@$value['name'])}} {{@$value['count']}} @endforeach @endif @endforeach
@foreach ($data as $key => $item) @if(@$key == "Order Status") @else

{{$key}} ({{count($item)}})

@if(@$key == "Order According Price") @php uasort($item, 'customSort'); $formattedData = []; foreach ($item as $newkey => $value) { $formattedData[$newkey] = $value; } $item = $formattedData; $last_currency = ""; $paid_amount = 0; $unpaid_amount = 0; @endphp @endif
@if(@$key == "Order According Price") @endif @foreach ($item as $property => $value) @if(@$key == "Order According Price") @if(($value['currency'] != $last_currency) && $last_currency != "") @php $paid_amount = 0; $unpaid_amount = 0; @endphp @endif @php $last_currency = $value['currency']; @endphp @endif @if ($value['name'] == '--') @else @if(@$key == "Order According Price") @php @$paid_amount = $paid_amount+@$value['paid']; @$unpaid_amount = @$unpaid_amount+@$value['unpaid']; @endphp @endif @endif @if(@$key == "Order According Price") @if($loop->last) @php $paid_amount = 0; $unpaid_amount = 0; @endphp @php $paid_amount = 0; $unpaid_amount = 0; @endphp @endif @endif @endforeach
Sr Name CountCurrency Total Paid Total Unpaid
Currency @if(isset($last_currency)) {{$last_currency}} @endif Total Paid Amount : {{$paid_amount}} Total Unpaid Amount : {{$unpaid_amount}}
{{ $loop->iteration }}Not Defined {{ @$value['count']}}{{ ucfirst(@$value['name'])}} {{ @$value['count']}}@if(@$value['currency']) {{@$value['currency']}} @endif @if(@$value['paid']) {{@$value['paid']}} @else 0 @endif @if(@$value['unpaid']) {{@$value['unpaid']}} @else 0 @endif
Currency @if(isset($last_currency)) {{$last_currency}} @endif Total Paid Amount : {{$paid_amount}} Total Unpaid Amount : {{$unpaid_amount}}
@if(empty($item))
Data Not Available
@endif
@endif @endforeach @php function customSort($a, $b) { $cmp = strcmp($a['currency'], $b['currency']); if ($cmp == 0) { return $a['id'] - $b['id']; } return $cmp; } @endphp