@if(!empty($data->data)) @php $id = 'store_stats'; $data = $data->data; $info = [ 'code' => [ 'label' => 'Code', 'wclass' => 'col-md-8', 'lclass' => 'col-md-3', ], 'name' => [ 'label' => 'Name', 'wclass' => 'col-md-8', 'lclass' => 'col-md-3', ], 'address' => [ 'label' => __('table.header.address'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-3', ], 'total_payed' => [ 'label' => __('label.message.total-payed'), 'wclass' => 'col-md-4', 'lclass' => 'col-md-6', 'vclass' => 'text-success text-bold pull-right', ], 'city' => [ 'label' => __('City'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-3', ], 'total_to_pay' => [ 'label' => __('label.message.total-to-pay'), 'wclass' => 'col-md-4', 'lclass' => 'col-md-6', 'vclass' => 'text-danger text-bold pull-right', ], ]; $orders_totals = [ 'count' => [ 'label' => __('label.message.orders-count'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-4', ], 'total_products_count' => [ 'label' => __('label.message.products-count'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-4', ], 'amount' => [ 'label' => __('label.message.total-amount'), 'wclass' => 'col-md-4', 'lclass' => 'col-md-6', 'vclass' => 'text-primary text-bold pull-right', ], 'first' => [ 'label' => __('label.message.first-order'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-4', ], 'payed' => [ 'label' => __('label.message.total-payed'), 'wclass' => 'col-md-4', 'lclass' => 'col-md-4', 'vclass' => 'text-success text-bold pull-right', ], 'last' => [ 'label' => __('label.message.last-order'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-4', ], 'to_pay' => [ 'label' => __('label.message.total-to-pay'), 'wclass' => 'col-md-4', 'lclass' => 'col-md-6', 'vclass' => 'text-danger text-bold pull-right', ], ]; $surpluses_totals = [ 'count' => [ 'label' => __('label.message.surpluses-count'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-4', ], 'total_products_count' => [ 'label' => __('label.message.products-count'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-4', ], 'credit' => [ 'label' => __('label.message.total-credit'), 'wclass' => 'col-md-4', 'lclass' => 'col-md-6', 'vclass' => 'text-primary text-bold pull-right', ], 'first' => [ 'label' => __('label.message.first-surplus'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-4', ], 'last' => [ 'label' => __('label.message.last-surplus'), 'wclass' => 'col-md-8', 'lclass' => 'col-md-4', ], ]; // ORDER MATTERS $orders_tables = [ $data->delivering, $data->ready, $data->delivered, $data->cancelled, ]; // ORDER MATTERS $surpluses_tables = [ $data->returned, ]; @endphp @include('components.data', [ 'layout' => $info, 'data' => $data ])
@php $i = 0; $orders_data = count($orders_tables); @endphp @foreach(array_merge($orders_tables, $surpluses_tables) as $table)
@if(empty($table))

{{ __('label.message.no-data') }}

@else @include('components.data', [ 'layout' => ( $i>$orders_data ) ? $surpluses_totals : $orders_totals, 'data' => $table ])
@if(empty($table->all_products))

{{ __('label.message.no-products') }}

@else
@php $j = 1; @endphp @foreach($table->all_products as $product) @endforeach
{{ __('table.header.id') }} {{ __('table.header.category') }} {{ __('table.header.code') }} {{ __('table.header.price') }} {{ __('table.header.quantity') }}
{{ $j++ }} {{ $product->category}} {{ $product->code }} {{ $product->price }} {{ $product->quantity }}
@endif
@endif
@endforeach
@endif