@if(isset($service_plan_reports['leads']) && count($service_plan_reports['leads']) > 0) @php $list_of_all = $dupicity = []; $totalQuantity = 0; $totalPrice = 0; @endphp @foreach($service_plan_reports['leads'] as $lead) @if(!is_null($lead->services_plan)) @if($lead->services_plan->name && $lead->quantity && $lead->services_plan->price) @if(!in_array($lead->services_plan->name."_".$lead->services_plan->model_number,$dupicity)) @else @endif @endif @endif @endforeach @foreach($list_of_all as $item) {{ $item['plan_name'] }} {{ $item['quantity'] }} {{ $item['revanu'] }} @endforeach @foreach($service_plan_reports['leads'] as $lead) @if(!is_null($lead->services_plan)) @if($lead->services_plan->name && $lead->quantity && $lead->services_plan->price) @php $totalQuantity += $lead->quantity; $totalPrice += $lead->services_plan->price * $lead->quantity; @endphp @endif @endif @endforeach Total {{ $totalQuantity }} {{ $totalPrice }} @else

No Service Report found.

@endif