@php
$others = array_slice($customers_natures['totals'] , 50 ,null,true ) ;
$allFormattedWithOthers = array_merge(
array_slice($customers_natures['totals'] , 0 , 50 , true) ,
count($others) ? [
(object)[
'customer_name'=>__('Others') . ' ( ' . count($others) . ' )' ,
'val'=>array_sum(array_column($others , 'val')) ,
'percentage'=>array_sum(array_column($others,'percentage'))
]
] : []
);
@endphp
@php
$order = 1 ;
@endphp
@slot('table_header')
| # |
{{ __('Customers') }} |
{{ __('Nature') }} |
{{ __('Sales Values') }} |
{{ __('%') }} |
@endslot
@slot('table_body')
@foreach ($allFormattedWithOthers as $key => $item)
| {{$key+1}} |
{{$item->customer_name }} |
{{getCustomerNature($item->customer_name , $customers_natures) }}
{{-- --}}
|
{{number_format($item->val)}} |
{{$item->percentage}} % |
@endforeach
| {{__('Total')}} |
|
- |
{{number_format(array_sum(array_column($allFormattedWithOthers,'val')))}} |
100 % |
@endslot
{{ __('Top 50 Customers Nature Breakdown') }}
| nature |
count |
sales |
@foreach(getSummaryCustomerDashboardForEachType($allFormattedWithOthers , $customers_natures) as $arrKey=> $data )
@if($arrKey)
| {{ $arrKey }} |
{{ $data['count'] ?? 0 }} |
{{ isset($data['sales']) ? number_format($data['sales']) : 0 }} |
@endif
@endforeach
{{--
@slot('table_header')
| # |
{{ __('Customers') }} |
{{ __('Sales Values') }} |
{{ __('Percentages %') }} |
@endslot
@slot('table_body')
@php $total = array_sum(array_column($customers_breakdown_data,'Sales Value')) @endphp
@foreach ($customers_breakdown_data as $key => $item)
| {{$key+1}} |
{{$item['item']?? '-'}} |
{{number_format($item['Sales Value']??0)}} |
{{$total == 0 ? 0 : number_format((($item['Sales Value']/$total)*100) , 1) . ' %'}} |
@endforeach
| {{__('Total')}} |
|
{{number_format($total)}} |
100 % |
@endslot
--}}