@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'
],
[
'label' => '',
'target' => 'detail_label',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
[
'label' => '',
'target' => 'detail_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.user'),
'target' => 'user_code',
'dclass' => 'lefted',
'hclass' => 'labelx'
],
[
'label' => __('table.header.store'),
'target' => 'store_code',
'dclass' => 'lefted',
'hclass' => 'labelx',
],
[
'label' => __('table.header.details'),
'target' => 'detail_code',
'dclass' => 'lefted',
'hclass' => 'labelx'
],
[
'label' => __('table.header.documents'),
'target' => 'documents_count',
],
[
'label' => __('table.header.payments'),
'target' => 'payments_count',
],
[
'label' => __('table.header.products'),
'target' => 'products_count',
],
[
'label' => __('table.header.total'),
'target' => 'total',
'dclass' => 'lefted bold',
],
[
'label' => __('table.header.payed'),
'target' => 'payed',
'dclass' => 'lefted text-success',
],
[
'label' => __('table.header.difference'),
'target' => 'to_pay',
'dclass' => 'lefted text-danger',
],
[
'label' => __('table.header.delivery'),
'target' => 'deliver_at',
],
[
'label' => __('table.header.registered'),
'target' => 'created_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.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