@include('components.datatable', [
    'route' => route('Shop.Invoices.index'),
    'model' => 'invoices',
    'with_add' => false,
    'with_filters' => true,
    'with_exports' => false,
    'with_print' => false,
    'show_callback' => 'InvoiceView(id);',
])

@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-invoices-filters'])
    @include('Shop.Invoices.partials.filters', ['model' => 'invoices'])
@endcomponent

@push('js')
    <script>
        function InvoiceView(id) {
            var url_open = "{{ route('Shop.Invoices.view') }}/" + id;
            openModal("Voir une facture", '#invoice-form', url_open, false, false, 'xl', {{ !($with_add ?? false) }});
        }

        function InvoiceRefresh() {
            reloadDatatable("invoices");
        }
    </script>
@endpush
