@push('style')
@endpush
@php
// TABLE HEADERS
# SEPARATED TO HANDLE CONFIG CONSTRUCTION IN THIS FILE
$headers = [
// EXTRA DATA HIDDEN
[
'label' => '',
'target' => 'order_id',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
[
'label' => '',
'target' => 'order_label',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
// VISIBLE DATA
[
'label' => __('table.header.id'),
'target' => 'id',
],
[
'label' => __('table.header.code'),
'target' => 'code',
],
[
'label' => __('table.header.name'),
'target' => 'name',
'dclass' => 'lefted',
'hclass' => 'labelx',
],
[
'label' => __('table.header.status'),
'target' => 'order_status',
],
[
'label' => __('table.header.order'),
'target' => 'order_code',
'dclass' => 'lefted',
],
[
'label' => __('table.header.payments'),
'target' => 'payments_count',
],
[
'label' => __('table.header.products'),
'target' => 'products_count',
],
[
'label' => __('table.header.total'),
'target' => 'order_total',
'dclass' => 'lefted bold',
],
[
'label' => __('table.header.payed'),
'target' => 'order_payed',
'dclass' => 'lefted text-success',
],
[
'label' => __('table.header.difference'),
'target' => 'order_to_pay',
'dclass' => 'lefted text-danger',
],
[
'label' => __('table.header.delivery'),
'target' => 'order_delivery',
],
[
'label' => __('table.header.registered'),
'target' => 'created_at',
],
[
'label' => __('table.header.notes'),
'target' => 'notes',
'hclass' => 'notes',
'wclass' => 'notes'
],
[
'label' => __('table.header.account'),
'hclass' => 'handle',
'target' => '_button',
'class' => 'btn btn-success account',
'icon' => 'fa fa-credit-card'
],
[
'label' => __('table.header.stats'),
'hclass' => 'handle',
'target' => '_button',
'class' => 'btn btn-info stats',
'icon' => 'fa fa-bar-chart-o'
],
[
'label' => __('table.header.edit'),
'target' => '_edit',
],
];
// GET HEADERS TARGETS
$col = array_flip( array_column($headers, 'target') );
@endphp
@include('components.table', [
'id' => $id,
'edit' => @$edit, // EDIT TARGET ID
'class' => 'table cell-border hover',
'data' => $data,
'headers' => $headers,
'targets' => [
'store' => 'store_id',
'order' => 'order_id'
],
'fields' => $col,
])
@push('ready')
@endpush