@push('style')
@endpush
@php
// TABLE HEADERS
# SEPARATED TO HANDLE CONFIG CONSTRUCTION IN THIS FILE
$headers = [
// EXTRA DATA HIDDEN
[
'label' => '',
'target' => 'label',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
[
'label' => '',
'target' => 'store_label',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
[
'label' => '',
'target' => 'store_id',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
// VISIBLE DATA
[
'label' => __('table.header.id'),
'target' => 'id',
],
[
'label' => __('table.header.code'),
'target' => 'code',
],
[
'label' => __('table.header.status'),
'target' => 'status_label',
],
[
'label' => __('table.header.courier'),
'target' => 'courier_code',
'dclass' => 'lefted',
'hclass' => 'labelx'
],
[
'label' => __('table.header.store'),
'target' => 'store_code',
'dclass' => 'lefted',
'hclass' => 'labelx',
],
[
'label' => __('table.header.products'),
'dclass' => 'products list',
'target' => 'products_count',
],
[
'label' => __('table.header.total'),
'target' => 'total_products_count',
],
[
'label' => __('table.header.credit'),
'target' => 'credit',
'dclass' => 'text-right text-success bold',
],
[
'label' => __('table.header.delivered'),
'target' => 'all_delivered_products_count',
'dclass' => 'bold text-primary',
],
[
'label' => __('table.header.returned'),
'target' => 'all_returned_products_count',
'dclass' => 'bold text-danger',
],
[
'label' => __('table.header.balance'),
'target' => 'store_balance',
'dclass' => 'text-right bold',
],
[
'label' => __('table.header.registered'),
'target' => 'created_at',
],
[
'label' => __('table.header.returned'),
'target' => 'returned_at',
],
[
'label' => __('table.header.notes'),
'target' => 'notes',
'hclass' => 'notes',
'wclass' => 'notes'
],
[
'label' => __('table.header.documents'),
'hclass' => 'handle',
'target' => '_button',
'class' => 'btn btn-info documents',
'icon' => 'fa fa-file-text-o'
],
[
'label' => __('table.header.edit'),
'target' => '_edit',
],
[
'label' => __('table.header.archive'),
'target' => '_archive',
],
[
'label' => __('table.header.delete'),
'target' => '_delete'
],
];
// 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,
'fields' => $col,
])
@push('ready')
@endpush