@extends('template.app')

@section('meta') @endsection

@section('title') Sales Report @endsection

@section('styles')
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
    <link href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.datatables.net/1.13.7/css/jquery.dataTables.min.css">
    <style>
        .table-responsive {
            overflow-x: auto;
            max-width: 100%;
        }
        
        .dataTables_scrollHeadInner,
        .dataTables_scrollBody table {
            width: 100% !important;
        }
        
        .dataTables_scrollHead {
            overflow: hidden;
        }
        .dataTables_scrollBody {
            max-height: 400px; 
            overflow-y: auto;
        }
        
        
        #sales-data-table {
            width: 100% !important;
            border-collapse: collapse;
        }
        
        #sales-data-table thead th {
            white-space: nowrap;
        }
       
        #sales-data-table_wrapper {
            width: 100%;
            overflow-x: auto;
        }
        
        td, th {
            border: 1px solid #dddddd;
            text-align: left;
            padding: 8px;
        }
        
        tr:nth-child(even) {
            background-color: #313762;
        }
        .daterangepicker {
            background-color: #fff !important;
            color: #000 !important;
            border: 1px solid #ccc;
            z-index: 9999;
        }
        
        .daterangepicker .calendar-table,
        .daterangepicker td,
        .daterangepicker th {
            background-color: #fff !important;
            color: #000 !important;
        }
        
        .daterangepicker td.active,
        .daterangepicker td.active:hover {
            background-color: #007bff !important;
            color: #fff !important;
        }
        
        .daterangepicker .drp-buttons .btn {
            background-color: #007bff;
            color: #fff;
        }
        
        .daterangepicker .drp-buttons .btn:hover {
            background-color: #0056b3;
        }
        
        .width_150 {
            width: 150px;
        }
        .width_200 {
            width: 200px;
        }
        .width_250 {
            width: 250px;
        }
        .width_300 {
            width: 300px;
        }
            
    </style>
@endsection

@section('content')
    <div class="page-breadcrumb">
            <div class="row">
            <div class="col-7 align-self-center">
                <h4 class="page-title text-truncate text-dark font-weight-medium mb-1">Sales Report</h4>
                <div class="d-flex align-items-center">
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb m-0 p-0">
                            <li class="breadcrumb-item"><a href="{{ route('dashboard') }}" class="text-muted">Dashboard</a></li>
                            <li class="breadcrumb-item"><a href="{{ route('allReport') }}" class="text-muted">Mis Report</a></li>
                            <li class="breadcrumb-item text-muted active" aria-current="page">Sales Report</li>
                        </ol>
                    </nav>
                </div>
            </div>
            <div class="col-5 align-self-center">
                <div class="customize-input float-right">
                    <button class="btn waves-effect waves-light btn-rounded btn-outline-primary pull-right" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
                        Export
                    </button>
                </div>
            </div>
            <div class="col-sm-8"></div>
            <div class="col-sm-4">
                <div class="col-md-12 align-self-center collapse" id="collapseExample">
                    <div class="customize-input float-right">
                        <form action="{{ route('salesExport') }}" method="get">
                            @csrf
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <select name="slug" class="form-control" required>
                                        <option value="">Select Status</option>
                                        <option value="all">All</option>
                                    </select>
                                </div>
                                <div class="form-group col-md-6">
                                    <button class="btn btn-primary" type="submit">Submit</button> 
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-body table-responsive" style="text-align: center;">
                        <table class="table table-bordered data-table tables" id="sales-data-table">        
                            <thead>
                                <tr>
                                    <th>No.</th>
                                    <th>Branch</th>
                                    <th>KEC Name</th>
                                    <th>Team Leader</th>
                                    <th>Date</th>
                                    <th>Particulars</th>
                                    <th>Bill to</th>
                                    <th>Bill to Address</th>
                                    <th>Ship to</th>
                                    <th>Ship to Address</th>
                                    <th>Invoice No</th>
                                    <th>Voucher Ref. No.- Hypo</th>
                                    <th>GSTIN/UIN</th>
                                    <th>PAN No.</th>
                                    <th>Addhar Card No</th>
                                    <th>Pan Link Status</th>
                                    <th>Quantity</th>
                                    <th>VIN No.</th>
                                    <th>Engine No.</th>
                                    <th>Model</th>
                                    <th>Varient</th>
                                    <th>Colour</th>
                                    <th>Gross Total</th>
                                    @foreach ($columnDefs as $col)
                                        <th>{!! $col['title'] !!}</th>
                                    @endforeach
                    
                                    <th>CGST Output -14%</th>
                                    <th>SGST Output -14%</th>
                                    <th>IGST Output -28%</th>
                    
                                    @foreach ($cess as $item)
                                        <th>Compensation Cess Output @ {{ $item->compensation_cess }}%</th>
                                    @endforeach
                                </tr>
                                <tr>
                                    <th></th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_300">
                                            <div class="form-group is-empty">
                                                <input type="text" name="branch_name" value="{{ request()->get('branch_name', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="1">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_200">
                                            <div class="form-group is-empty">
                                                <input type="text" name="sales_person_name" value="{{ request()->get('sales_person_name', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="2">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_200">
                                            <div class="form-group is-empty">
                                                <input type="text" name="team_name" value="{{ request()->get('team_name', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="3">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="date" value="{{ request()->get('date', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="4" id="date" placeholder="DD-MM-YYYY to DD-MM-YYYY">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_300">
                                            <div class="form-group is-empty">
                                                <input type="text" name="particulars" value="{{ request()->get('particulars', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="5">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_300">
                                            <div class="form-group is-empty">
                                                <input type="text" name="bill_to" value="{{ request()->get('bill_to', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="7">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_200">
                                            <div class="form-group is-empty">
                                                <input type="text" name="bill_to_address" value="{{ request()->get('bill_to_address', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="8">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_300">
                                            <div class="form-group is-empty">
                                                <input type="text" name="ship_to_customer_name" value="{{ request()->get('ship_to_customer_name', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="9">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_200">
                                            <div class="form-group is-empty">
                                                <input type="text" name="ship_to_address" value="{{ request()->get('ship_to_address', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="10">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="invoice_no" value="{{ request()->get('invoice_no', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="11">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_300">
                                            <div class="form-group is-empty">
                                                <input type="text" name="hypo" value="{{ request()->get('hypo', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="12">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_200">
                                            <div class="form-group is-empty">
                                                <input type="text" name="gst_no" value="{{ request()->get('gst_no', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="13">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="pan_no" value="{{ request()->get('pan_no', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="14">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_200">
                                            <div class="form-group is-empty">
                                                <input type="text" name="adhar_number" value="{{ request()->get('adhar_number', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="15">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="aadhar_pan_link" value="{{ request()->get('aadhar_pan_link', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="16">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_200">
                                            <div class="form-group is-empty">
                                                <input type="text" name="vin_number" value="{{ request()->get('vin_number', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="18">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="engine_number" value="{{ request()->get('engine_number', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="19">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="car_model" value="{{ request()->get('car_model', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="20">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_300">
                                            <div class="form-group is-empty">
                                                <input type="text" name="car_varient" value="{{ request()->get('car_varient', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="21">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_200">
                                            <div class="form-group is-empty">
                                                <input type="text" name="exterior_color" value="{{ request()->get('exterior_color', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="22">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="gross_total" value="{{ request()->get('gross_total', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="23">
                                            </div>
                                        </div>
                                    </th>
                                    @php $tabIndex = 23; @endphp
                                    @foreach ($columnDefs as $column)
                                        <th>
                                            <div class="search-box-container datatable-form-filter width_200">
                                                <div class="form-group is-empty">
                                                    <input type="text" name="{{ $column['data'] }}" value="{{ request()->get($column['data'], '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="{{ $tabIndex++ }}">
                                                </div>
                                            </div>
                                        </th>
                                    @endforeach
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="cgst" value="{{ request()->get('cgst', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="{{ $tabIndex++ }}">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="sgst" value="{{ request()->get('sgst', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="{{ $tabIndex++ }}">
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="search-box-container datatable-form-filter width_150">
                                            <div class="form-group is-empty">
                                                <input type="text" name="igst" value="{{ request()->get('igst', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="{{ $tabIndex++ }}">
                                            </div>
                                        </div>
                                    </th>
                                    @foreach ($cess as $item)
                                        @php
                                            $cessKey = \Illuminate\Support\Str::slug("Compensation Cess Output @ {$item->compensation_cess} %", '_');
                                        @endphp
                                        <th>
                                            <div class="search-box-container datatable-form-filter width_300">
                                                <div class="form-group is-empty">
                                                    <input type="text" name="{{ $cessKey }}" value="{{ request()->get($cessKey, '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="{{ $tabIndex++ }}">
                                                </div>
                                            </div>
                                        </th>
                                    @endforeach
                                </tr>
                            </thead>
                            <tbody></tbody>
                        </table>
                    </div>
                </div>
            </div>    
        </div>
    </div>
@endsection

@section('scripts')
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.7/js/dataTables.bootstrap5.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
    <script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script>
    <script src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
    <script src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
    
    
    <script type="text/javascript">
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
    </script>
    
    <script>
        $(document).ready(function() { 
            
            $('#date').daterangepicker({
                autoUpdateInput: false,
                locale: {
                    format: 'DD-MM-YYYY',
                    cancelLabel: 'Clear'
                }
            });
        
            $('#date').on('apply.daterangepicker', function(ev, picker) {
                $(this).val(picker.startDate.format('DD-MM-YYYY') + ' to ' + picker.endDate.format('DD-MM-YYYY'));
                $('#sales-data-table').DataTable().draw();
            });
        
            $('#date').on('cancel.daterangepicker', function(ev, picker) {
                $(this).val('');
                $('#sales-data-table').DataTable().draw();
            });
            
            let columnDefs = {!! json_encode($columnDefs) !!};
            var tableColumns = [
                {data: null, title: 'No.', class: 'text-center', orderable: false,
                    render: function (data, type, row, meta) {
                        return meta.row + meta.settings._iDisplayStart + 1;
                    }
                },
                {data: 'branch_name', name: 'branch_name', title: 'Location', class: 'text-center'},
                {data: 'sales_person_name', name: 'sales_person_name', title: 'KEC Name', class: 'text-center'},
                {data: 'team_name', name: 'team_name', title: 'Team Leader', class: 'text-center'},
                {data: 'date', name: 'date', title: 'Date', class: 'text-center'},
                {data: 'particulars', name: 'particulars', title: 'Particulars', class: 'text-center'},
                {data: 'bill_to', name: 'bill_to', title: 'Bill to', class: 'text-center'},
                {data: 'bill_to_address', name: 'bill_to_address', title: 'Bill to Address', className: 'text-center',
                    render: function (data, type, row) {
                        if (!data) return '';
                        let shortText = data.length > 15 ? data.substr(0, 15) + '...' : data;
                        return `<span title="${data.replace(/"/g, '&quot;')}">${shortText}</span>`;
                    }
                },
                {data: 'ship_to_customer_name', name: 'ship_to_customer_name', title: 'Ship to', class: 'text-center'},
                {data: 'ship_to_address', name: 'ship_to_address', title: 'Ship to Address', className: 'text-center',
                    render: function (data, type, row) {
                        if (!data) return '';
                        let shortText = data.length > 15 ? data.substr(0, 15) + '...' : data;
                        return `<span title="${data.replace(/"/g, '&quot;')}">${shortText}</span>`;
                    }
                },
                {data: 'invoice_no', name: 'invoice_no', title: 'Invoice No', class: 'text-center'},
                {data: 'hypo', name: 'hypo', title: 'Voucher Ref. No.- Hypo', class: 'text-center'},
                {data: 'gst_no', name: 'gst_no', title: 'GSTIN/UIN', class: 'text-center'},
                {data: 'pan_no', name: 'pan_no', title: 'PAN No.', class: 'text-center'},
                {data: 'adhar_number', name: 'adhar_number', title: 'Aadhar Card No', class: 'text-center'},
                {data: 'aadhar_pan_link', name: 'aadhar_pan_link', title: 'Pan Link Status', class: 'text-center'},
                {data: 'qty', name: 'qty', title: 'Quantity', class: 'text-center'},
                {data: 'vin_number', name: 'vin_number', title: 'VIN No.', class: 'text-center'},
                {data: 'engine_number', name: 'engine_number', title: 'Engine No.', class: 'text-center'},
                {data: 'car_model', name: 'car_model', title: 'Model', class: 'text-center'},
                {data: 'car_varient', name: 'car_varient', title: 'Varient', class: 'text-center'},
                {data: 'exterior_color', name: 'exterior_color', title: 'Exterior Color', class: 'text-center'},
                {data: 'gross_total', name: 'gross_total', title: 'Gross Total', class: 'text-center'},
                ...@json($columnDefs),
                {data: 'cgst', title: 'CGST Output -14%'},
                {data: 'sgst', title: 'SGST Output -14%'},
                {data: 'igst', title: 'IGST Output -28%'},
                @foreach ($cess as $item)
                    {data: '{{ Str::slug("Compensation Cess Output @ {$item->compensation_cess} %", "_") }}', title: 'Compensation Cess Output @ {{ $item->compensation_cess }}%', class: 'text-center'},
                @endforeach
            ];
        
            (function(window, $) {
                window.LaravelDataTables = window.LaravelDataTables || {};
                window.LaravelDataTables["dataTableBuilder"] = $("#sales-data-table").DataTable({
                    processing: true,
                    serverSide: true,
                    language: {
                        "info": "_START_ - _END_ of _TOTAL_",
                        "lengthMenu": "_MENU_ ",
                        "infoFiltered": ""
                    },
                    scrollX: true,
                    scrollY: '750px',
                    scrollCollapse: true,
                    paging: true,
                    fixedHeader: false,
                    searching: false,
                    autoWidth: false,
                    bSortCellsTop : true,
                    ajax: {
                        url: '{!! route("SalesReportFetch") !!}',
                        type: 'POST',
                        data: function (d) {
                            d._token = '{{ csrf_token() }}';
                            d.branch_name = jQuery(".datatable-form-filter input[name='branch_name']").val();
                            d.sales_person_name = jQuery(".datatable-form-filter input[name='sales_person_name']").val();
                            d.team_name = jQuery(".datatable-form-filter input[name='team_name']").val();
                            d.date = jQuery(".datatable-form-filter input[name='date']").val();
                            d.particulars = jQuery(".datatable-form-filter input[name='particulars']").val();    
                            d.particulars = jQuery(".datatable-form-filter input[name='particulars']").val();
                            d.bill_to = jQuery(".datatable-form-filter input[name='bill_to']").val();
                            d.bill_to_address = jQuery(".datatable-form-filter input[name='bill_to_address']").val();
                            d.ship_to_customer_name = jQuery(".datatable-form-filter input[name='ship_to_customer_name']").val();
                            d.ship_to_address = jQuery(".datatable-form-filter input[name='ship_to_address']").val();
                            d.invoice_no = jQuery(".datatable-form-filter input[name='invoice_no']").val();
                            d.hypo = jQuery(".datatable-form-filter input[name='hypo']").val();
                            d.gst_no = jQuery(".datatable-form-filter input[name='gst_no']").val();
                            d.pan_no = jQuery(".datatable-form-filter input[name='pan_no']").val();
                            d.adhar_number = jQuery(".datatable-form-filter input[name='adhar_number']").val();
                            d.aadhar_pan_link = jQuery(".datatable-form-filter input[name='aadhar_pan_link']").val();
                            d.vin_number = jQuery(".datatable-form-filter input[name='vin_number']").val();
                            d.engine_number = jQuery(".datatable-form-filter input[name='engine_number']").val();
                            d.car_model = jQuery(".datatable-form-filter input[name='car_model']").val();
                            d.car_varient = jQuery(".datatable-form-filter input[name='car_varient']").val();
                            d.exterior_color = jQuery(".datatable-form-filter input[name='exterior_color']").val();
                            d.gross_total = jQuery(".datatable-form-filter input[name='gross_total']").val();
                            @foreach ($columnDefs as $column)
                                d.{{ $column['data'] }} = $(".datatable-form-filter input[name='{{ $column['data'] }}']").val();
                            @endforeach
                            d.cgst = jQuery(".datatable-form-filter input[name='cgst']").val();
                            d.sgst = jQuery(".datatable-form-filter input[name='sgst']").val();
                            d.igst = jQuery(".datatable-form-filter input[name='igst']").val();
                            @foreach ($cess as $item)
                                @php
                                    $cessKey = \Illuminate\Support\Str::slug("Compensation Cess Output @ {$item->compensation_cess} %", '_');
                                @endphp
                                d.{{ $cessKey }} = $(".datatable-form-filter input[name='{{ $cessKey }}']").val();
                            @endforeach
                        },
                        error : function(d) {}
                    },
                    columns: tableColumns,
                    lengthMenu: [
                        [25, 50,100, -1 ],['25', '50','100', 'Show all' ]
                    ],
                    order: [ [0,'DESC'] ],
                    responsive: true,
                    colReorder:{
                        enable: false,
                    },
                    dom: '<"top"f>rt<"bottom"ipl><"clear">',
                    fnInitComplete: function(settings, json) {
                        jQuery('table.table input:checkbox').map(function() {
                            if(jQuery(this).prop("checked") != true){
                                var column = table.column( jQuery(this).attr('data-column') );
                                column.visible(false);
                            }
                        });
                    },
                    pageLength: 25,
                });
            })(window, jQuery);
            
            $('.datatable-form-filter input').on('keyup', function (e) {
                if($(this).val().length >= 3 || e.keyCode == 13 || !$(this).val()) {
                    window.LaravelDataTables["dataTableBuilder"].draw();
                    e.preventDefault();
                }
            });
        
            $('.datatable-form-filter select').on('change', function (e) {
                window.LaravelDataTables["dataTableBuilder"].draw();
                e.preventDefault();
            });
        
            $('input:checkbox[name="name_sort_asc"],input:checkbox[name="name_sort_desc"]').on('click', function (e) {
                window.LaravelDataTables["dataTableBuilder"].draw();
                e.preventDefault();
            });
        });
    </script>
@endsection
