@section('summary') @php $e=$data->sum('entitled'); @endphp @if ($e)

Summary

Deployment{{ number_format($data->sum('actual')/$e*100,1) }}%
Deployment (with Ahead){{ number_format(($data->sum('actual')+$data->sum('ahead'))/$e*100,1) }}%
Should Be{{ number_format(($data->sum('actual')+$data->sum('behind'))/$e*100,1) }}%
Gap{{ number_format($data->sum('behind')/$e*100,1) }}%
Deployment with Plans{{ number_format(($data->sum('actual')+$data->sum('ahead')+$data->sum('assigned'))/$e*100,1) }}%
Unassigned{{ number_format($data->sum('unassigned')/$e*100,1) }}%

Substition Estimatation

Sub InsJ${{ $si=number_format($data->sum('subin'),3) }}m
Sub OutsJ${{ $so=number_format($data->sum('subout'),3) }}m
@endif
Clients {{ $n=$data->filter(function($item) { return array_get($item,'entitled',0) > 0; })->count() }}
J${{ $data->sum('entitled') }}m
Deployed {{ $d=($data->filter(function($item) { return array_get($item,'actual',0) > 0; })->count()) }}
J${{ $data->sum('actual')+$data->sum('ahead') }}m
Not Deploying {{ $not=($data->filter(function($item) { return array_get($item,'actual',0) == 0 AND $item['assigned'] == 0 AND $item['entitled'] > 0; })->count()) }}
J${{ $data->filter(function($item) { return array_get($item,'actual',0) == 0 AND $item['assigned'] == 0 AND $item['entitled'] > 0; })->sum('unassigned') }}m
Behind {{ $b=($data->filter(function($item) { return array_get($item,'behind',0) > 0; })->count()) }}
J${{ $data->sum('behind') }}m
No Plans {{ $u=($data->filter(function($item) { return array_get($item,'unassigned',0) > 0; })->count()) }}
J${{ $data->sum('unassigned') }}m
Sub Estimate {{ $data->filter(function($item) use ($si,$so) { return array_get($item,($si >= $so ? 'subin' : 'subout'),0) > 0; })->count() }} @if( $si >= $so) J${{ $si }}m @else J${{ $so }}m @endif

Deployment Data: {{ $co->name }} ({{$co->segment->unit->name."|".$co->segment->name}}) as at {{ $ido->import_date->format('Y-m-d') }}

@foreach ($model->find($data->pluck($model_key)->unique())->sortBy('name') as $o) @php $row = $data->where($model_key,$o->id); if (! $row->sum('entitled') AND ! $row->sum('over') AND ! Request::query('hidden')) continue; @endphp @endforeach
{{ $name }} Entitled Deployed Behind Assigned Unassigned
Actual Ahead Over
{{ $o->name }} {{ number_format($row->sum('entitled'),3) }} {{ number_format($row->sum('actual'),3) }} {{ number_format($row->sum('ahead'),3) }} {{ number_format($row->sum('over'),3) }} {{ number_format($row->sum('behind'),3) }} {{ number_format($row->sum('assigned'),3) }} {{ number_format($row->sum('unassigned'),3) }}
TOTAL {{ number_format($e,3) }} {{ number_format($data->sum('actual'),3) }} {{ number_format($data->sum('ahead'),3) }} {{ number_format($data->sum('over'),3) }} {{ number_format($data->sum('behind'),3) }} {{ number_format($data->sum('assigned'),3) }} {{ number_format($data->sum('unassigned'),3) }}
@endsection @include('widgets.donut_chart',['chart'=>[ 'entitled'=>$data->sum('entitled'), 'over'=>$data->sum('over'), 'actual'=>$data->sum('actual'), 'ahead'=>$data->sum('ahead'), 'behind'=>$data->sum('behind'), 'assigned'=>$data->sum('assigned'), 'unassigned'=>$data->sum('unassigned'), ]])