Score Board-1 For: Distributor
Month {{date('M Y',strtotime($date))}} Distributor {{$distributor->distributor_name}} Town {{$distributor->city_name}} Territory {{$distributor->territory_name}} Zone {{$distributor->area_name}}
@for($day=1;$day<=$days;$day++) @endfor @for($day=1;$day<=$days;$day++) @endfor @for($day=1;$day<=$days;$day++) @endfor @php($sum_assigned_shop=0) @foreach($total_dist_data as $thisdate) @php($sum_assigned_shop +=$thisdate->assigned_shop) @endforeach @php($sum_productivity=0) @foreach($total_dist_data as $thisdate) @php($sum_productivity +=$thisdate->productivity) @endforeach @php($sum_productiv_shops=0) @foreach($total_dist_data as $thisdate) @php($sum_productiv_shops += $thisdate->productiv_shops) @endforeach @php($sum_booking=0) @foreach($total_dist_data as $thisdate) @php($sum_booking +=$thisdate->booking) @endforeach @php($sum_execution=0) @foreach($total_dist_data as $thisdate) @php($sum_execution +=$thisdate->execution) @endforeach @foreach($total_dist_data as $thisdate) @endforeach @foreach($total_dist_data as $thisdate) @endforeach {{--@dd($employees)--}} @foreach($employees as $key=>$employee) @foreach($employee->data as $thisdate) @endforeach @php($sum_total_shops = 0) @foreach($employee->data as $thisdate) @php($sum_total_shops += $thisdate->total_shops) @endforeach @php($sum_executed_productive_shops = 0) @foreach($employee->data as $thisdate) @php($sum_executed_productive_shops += $thisdate->executed_productive_shops) @endforeach @php($sum_productive_shops = 0) @foreach($employee->data as $thisdate) @php($sum_productive_shops += $thisdate->executed_productive_shops) @endforeach @php($sum_booked_parent_qty = 0) @foreach($employee->data as $thisdate) @php($sum_booked_parent_qty += $thisdate->booked_parent_qty) @endforeach @php($sum_executed_parent_qty = 0) @foreach($employee->data as $thisdate) @php($sum_executed_parent_qty += $thisdate->executed_parent_qty) @endforeach @foreach($employee->data as $thisdate) @endforeach @foreach($employee->data as $thisdate) @endforeach @endforeach
Sale Rep Date{{$day}}-{{date('M',strtotime($date))}}Average
With hiring date Day{{date('D',strtotime($day."-".$month_year))}}
Total Distributor Sales Target{{ date('D',strtotime($day."-".$month_year)) == 'Sun' ? 0:number_format($total_perday_target,2) }}{{number_format($total_perday_target,2)}}
Assigned Shops{{number_format($thisdate->assigned_shop,2)}}{{number_format(($sum_assigned_shop)/$workingdays,2)}}
Productive Shops{{number_format($thisdate->productivity,2)}}{{number_format(($sum_productivity)/$workingdays,2)}}
Productivity %{{number_format($thisdate->productivityPer,2)}}%{{number_format($sum_assigned_shop < 1 || $sum_productiv_shops < 1 ? 0: (($sum_productiv_shops/$sum_assigned_shop)*100)/$workingdays,2)}}%
Booking{{number_format($thisdate->booking,2)}}{{number_format($sum_booking>0?($sum_booking)/$workingdays:0,2)}}
Execution{{number_format($thisdate->execution,2)}}{{number_format($sum_execution>0?($sum_execution)/$workingdays:0,2)}}
% TGT Achieved{{number_format($thisdate->target_achieved,2)}}%{{number_format($sum_execution < 1 || $thisdate->total_target < 1 ? 0: (($sum_execution/$thisdate->total_target)*100)/$workingdays,2)}}%
Drop Size{{number_format($thisdate->drop_size,2)}}{{number_format($sum_execution < 1 || $sum_productiv_shops < 1 ? 0: ($sum_execution/$sum_productiv_shops)/$workingdays,2)}}
{{$employee->employee_first_name}} {{$employee->employee_last_name}}
{{$key+1}}
({{$employee->employee_hire_at}})
Sales Target{{number_format($employee->assigned_target > 0 ? $employee->assigned_target/$workingdays: 0,2) }}{{number_format($employee->assigned_target > 0 ? $employee->assigned_target/$workingdays: 0,2) }}
Assigned Shops{{number_format($thisdate->total_shops,2)}}{{number_format($sum_total_shops>0?($sum_total_shops)/$workingdays:0,2)}}
Productive Shops{{number_format($thisdate->executed_productive_shops>0 ? $thisdate->executed_productive_shops : 0,2)}}{{number_format($sum_executed_productive_shops>0?($sum_executed_productive_shops)/$workingdays:0,2)}}
Productivity %{{number_format($thisdate->total_shops < 1 || $thisdate->executed_productive_shops < 1 ? 0: ($thisdate->executed_productive_shops/$thisdate->total_shops)*100,2)}}%{{number_format(($sum_productive_shops < 1 || $sum_total_shops < 1 ? 0: ($sum_total_shops/$sum_productive_shops)*100)/$workingdays,2)}}%
Booking{{number_format($thisdate->booked_parent_qty,2)}}{{number_format($sum_booked_parent_qty>0?($sum_booked_parent_qty)/$workingdays:0,2)}}
Execution{{number_format($thisdate->executed_parent_qty,2)}}{{number_format($sum_executed_parent_qty>0?($sum_executed_parent_qty)/$workingdays:0,2)}}
% TGT Achieved{{number_format($thisdate->executed_parent_qty < 1 || $employee->assigned_target < 1 ? 0: ($thisdate->executed_parent_qty/$employee->assigned_target)*100,2)}}%{{number_format($sum_executed_parent_qty < 1 || $employee->assigned_target < 1 ? 0:((($sum_executed_parent_qty/$employee->assigned_target)*100)/$workingdays),2)}}%
Drop Size{{number_format($thisdate->executed_parent_qty < 1 || $thisdate->executed_productive_shops < 1 ? 0: ($thisdate->executed_parent_qty/$thisdate->executed_productive_shops),2)}}{{number_format($sum_executed_parent_qty>0 && $sum_productive_shops >0 ?(($sum_executed_parent_qty/$sum_productive_shops))/$workingdays:0,2)}}