@extends('template.app')



@section('meta') @endsection

@section('title') OBF 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 {

        font-family: Arial, sans-serif;

        border-collapse: collapse;

        width: 100%;

    }



    td, th {

        border: 1px solid #dddddd;

        text-align: left;

        padding: 8px;

    }



    /*tr:nth-child(even) {*/

    /*    background-color: #313762;*/

    /*}*/



    div.dataTables_wrapper div.dataTables_filter label {

        font-weight: normal;

        white-space: nowrap;

        margin-left: auto;

        margin-right: auto;

    }



    .table-responsive {

        overflow-x: auto;

        max-width: 100%;

    }

    /* Commented by Kerav */

    /*.card-body {

        overflow-x: auto;

        max-width: 100%;

        margin-right: 40px;

        margin-left: 40px;

    }



    .card-header {

        margin-right: 40px;

        margin-left: 40px;

    }


    .card.mt-4, .card {

        margin: 20px 40px;

    }*/

    /* Commented by Kerav */



    .dataTables_wrapper {

        width: 100%;

        max-width: 100%;

        overflow-x: auto;

    }

</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">OBF 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">OBF 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('ObfReportExport') }}" 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" id="datatable" style="text-align: center;">

                    <table class="table table-bordered data-table tables" id="data-table" cellspacing="0" width="100%">

                        <thead>

                            <tr>

                                <th>No</th>

                                <th>Date</th>

                                <th>Location</th>

                                <th>Customer Name</th>

                                <th> GST No </th>

                                <th> Team Leader </th>

                                <th> KEC Name </th>

                                <th> Model </th>

                                <th> Variant </th>

                                <th> Exterior Color </th>

                                <th> VIN Number </th>

                                <th width="100"> On Road Price(A) </th>

                                <th> Booking Amount (B(+)) </th>

                                <th> DP Amount Received (C(+)) </th>

                                <th> Finance Amount </th> 

                                <th> Net Disbusment Amount (D(+)) </th>

                                <th> Exchange Amount (E(+)) </th>

                                <th> Total received amount (B+C+D+E = F) </th>

                                <th> Discount (G(-)) </th>

                                <th width="100"> Net Amount Received (F-G=H) </th>

                                <th width="100"> Access / Sort Amount </th>

                                <th width="100"> Due Amount  (A-H=I) </th>

                                <th> OBF Status </th>

                                <th> OBF Approval Status </th>

                                <th> Invoice No.</th>

                                <th> Invoice Date </th>

                                <th> EW Status </th>

                                <th> MCP Status </th>

                                <th> RSA Status </th>

                                <th> Accessory Status </th>

                                <th> RTO Status </th>

                                <th> Insurance Status </th>

                                <th> Fasttag Status</th>

                                <th> Municipal Tax Status</th>

                            </tr>

                            <tr class="filterrow">

                                <th></th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_150">

                                        <div class="form-group is-empty">

                                            <input type="text" name="booking_date" value="{{ request()->get('booking_date', '') }}" class="form-control text-capitalize" autocomplete="off" tabindex="1" id="booking_date" placeholder="DD-MM-YYYY to DD-MM-YYYY">

                                        </div>

                                    </div>

                                </th>



                                <th>

                                    <div class="search-box-container datatable-form-filter width_250">

                                        <div class="form-group is-empty">

                                            <input type="text" name="branch_name" value="{{ request()->get('branch_name', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="2">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_300">

                                        <div class="form-group is-empty">

                                            <input type="text" name="customer_name" value="{{ request()->get('customer_name', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus 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="gst" value="{{ request()->get('gst', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="4">

                                        </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 custom_color" autocomplete="off" autofocus tabindex="5">

                                        </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 custom_color" autocomplete="off" autofocus tabindex="6">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_150">

                                        <div class="form-group is-empty">

                                            <input type="text" name="product" value="{{ request()->get('product', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="7">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_250">

                                        <div class="form-group is-empty">

                                            <input type="text" name="car_varient_name" value="{{ request()->get('car_varient_name', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="8">

                                        </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 custom_color" autocomplete="off" autofocus 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="vin_number" value="{{ request()->get('vin_number', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus 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="on_road_price" value="{{ request()->get('on_road_price', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="11">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_150">

                                        <div class="form-group is-empty">

                                            <input type="text" name="booking_amount" value="{{ request()->get('booking_amount', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="12">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_150">

                                        <div class="form-group is-empty">

                                            <input type="text" name="dp_amount" value="{{ request()->get('dp_amount', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus 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="loan_amount" value="{{ request()->get('loan_amount', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="14">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_150">

                                        <div class="form-group is-empty">

                                            <input type="text" name="net_disbusment" value="{{ request()->get('net_disbusment', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus 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="total_exchange_amount" value="{{ request()->get('total_exchange_amount', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="16">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_150">

                                        <div class="form-group is-empty">

                                            <input type="text" name="final_total" value="{{ request()->get('final_total', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="17">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_150">

                                        <div class="form-group is-empty">

                                            <input type="text" name="finance_discount" value="{{ request()->get('finance_discount', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus 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="net_total" value="{{ request()->get('net_total', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus 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="access_sort_amount" value="{{ request()->get('access_sort_amount', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="20">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_150">

                                        <div class="form-group is-empty">

                                            <input type="text" name="due_amount" value="{{ request()->get('due_amount', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="21">

                                        </div>

                                    </div>

                                </th>

                                <th>

                                    <div class="search-box-container datatable-form-filter width_150">

                                        <div class="form-group is-empty">

                                            <input type="text" name="status" value="{{ request()->get('status', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus 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="approval_status" value="{{ request()->get('approval_status', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="23">

                                        </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 custom_color" autocomplete="off" autofocus tabindex="24">

                                        </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_date" value="{{ request()->get('invoice_date', '') }}" class="form-control text-capitalize custom_color" autocomplete="off" autofocus tabindex="24">

                                        </div>

                                    </div>

                                </th>

                                <th><div class="search-box-container datatable-form-filter width_150"></div></th>

                                <th><div class="search-box-container datatable-form-filter width_150"></div></th>

                                <th><div class="search-box-container datatable-form-filter width_150"></div></th>

                                <th><div class="search-box-container datatable-form-filter width_150"></div></th>

                                <th><div class="search-box-container datatable-form-filter width_150"></div></th>

                                <th><div class="search-box-container datatable-form-filter width_150"></div></th>

                                <th><div class="search-box-container datatable-form-filter width_150"></div></th>

                                <th><div class="search-box-container datatable-form-filter width_150"></div></th>

                            </tr>

                        </thead>

                    </table>

                </div>

            </div>

        </div>

@endsection



@section('scripts')

<script src="https://code.jquery.com/jquery-3.6.0.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.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>

<script src="https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap5.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.datatables.net/1.13.7/js/jquery.dataTables.min.js"></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 type="text/javascript">

    



    $(document).ready(function() {

        $('#booking_date').daterangepicker({

            autoUpdateInput: false,

            locale: {

                format: 'DD-MM-YYYY',

                cancelLabel: 'Clear'

            }

        });

    

        $('#booking_date').on('apply.daterangepicker', function(ev, picker) {

            $(this).val(picker.startDate.format('DD-MM-YYYY') + ' to ' + picker.endDate.format('DD-MM-YYYY'));

            $('#data-table').DataTable().draw();

        });

    

        $('#booking_date').on('cancel.daterangepicker', function(ev, picker) {

            $(this).val('');

            $('#data-table').DataTable().draw();

        });

        

        let rowCount = $("table tbody tr").length;

        if (rowCount < 3) {

            $(".table").css("height", "600px");

        }



        $('.js-example-basic-single').select2();



        var tableColumns = [

            {data: 'id', name: 'id',class:'text-center id',title: 'No.', orderable: false, width:100,default: true},

            {data: 'booking_date', name: 'booking_date',class:'text-center booking_date',title: 'Date', orderable: false,default: true},

            {data: 'branch_name', name: 'branch_name',class:'text-center branch_name',title: 'Location', orderable: true,default: true},

            {data: 'customer_name', name: 'customer_name',class:'text-center customer_name',title: 'Customer Name', orderable: true,default: true},

            {data: 'gst', name: 'gst',class:'text-center gst',title: 'GST No.', orderable: true,default: true},

            {data: 'team_name', name: 'team_name',class:'text-center team_name',title: 'Team Leader', orderable: true,default: true},

            {data: 'sales_person_name', name: 'sales_person_name',class:'text-center sales_person_name',title: 'KEC Name', orderable: true,default: true},

            {data: 'product', name: 'product',class:'text-center product',title: 'Model', orderable: true,default: true},

            {data: 'car_varient_name', name: 'car_varient_name',class:'text-center car_varient_name',title: 'Variant', orderable: true,default: true},

            {data: 'exterior_color', name: 'exterior_color',class:'text-center exterior_color',title: 'Exterior Color', orderable: true,default: true},

            {data: 'vin_number', name: 'vin_number',class:'text-center vin_number',title: 'VIN No.', orderable: true,default: true},

            {data: 'on_road_price', name: 'on_road_price',class:'text-center on_road_price',title: 'On Road Price (A)', orderable: false,default: true},

            {data: 'booking_amount', name: 'booking_amount',class:'text-center booking_amount',title: 'Booking Amount (B(+))', orderable: false,default: true},

            {data: 'dp_amount', name: 'dp_amount',class:'text-center dp_amount',title: 'DP Amount Received (C(+))', orderable: false,default: true},

            {data: 'loan_amount', name: 'loan_amount',class:'text-center loan_amount',title: 'Finance Amount', orderable: false,default: true},

            {data: 'net_disbusment', name: 'net_disbusment',class:'text-center net_disbusment',title: 'Net Disbusment Amount (D(+))', orderable: false,default: true},

            {data: 'total_exchange_amount', name: 'total_exchange_amount',class:'text-center total_exchange_amount',title: 'Exchange Amount (E(+))', orderable: false,default: true},

            {data: 'final_total', name: 'final_total',class:'text-center final_total',title: 'Total received amount (B+C+D+E = F)', orderable: false,default: true},

            {data: 'finance_discount', name: 'finance_discount',class:'text-center finance_discount',title: 'Total Discount (G(-))', orderable: false,default: true},

            {data: 'net_total', name: 'net_total',class:'text-center net_total',title: 'Total Amount Receivable (A-G = H)', orderable: false,default: true},

            {data: 'access_sort_amount', name: 'access_sort_amount',class:'text-center access_sort_amount',title: 'Access / Sort Amount', orderable: false,default: true},

            {data: 'due_amount', name: 'due_amount',class:'text-center due_amount',title: 'Due Amount  (H-F=J)', orderable: false,default: true},

            {data: 'status', name: 'status',class:'text-center status',title: 'Finance Progress Status', orderable: true,default: true},

            {data: 'approval_status', name: 'approval_status',class:'text-center approval_status',title: 'Sales Progress Status', orderable: true,default: true},

            {data: 'invoice_no', name: 'invoice_no',class:'text-center invoice_no',title: 'Invoice No.', orderable: true,default: true},

            {data: 'invoice_date', name: 'invoice_date',class:'text-center invoice_date',title: 'Invoice Date', orderable: true,default: true},

            {data: 'ew_status', name: 'ew_status',class:'text-center ew_status',title: 'EW Status', orderable: true,default: true},

            {data: 'mcp_status', name: 'mcp_status',class:'text-center mcp_status',title: 'MCP Status', orderable: true,default: true},

            {data: 'rsa_status', name: 'rsa_status',class:'text-center rsa_status',title: 'RSA Status', orderable: true,default: true},

            {data: 'accesories_status', name: 'accesories_status',class:'text-center accesories_status',title: 'Accessory Status', orderable: true,default: true},

            {data: 'rto_status', name: 'rto_status',class:'text-center rto_status',title: 'RTO Status', orderable: true,default: true},

            {data: 'insurance_status', name: 'insurance_status',class:'text-center insurance_status',title: 'Insurance Status', orderable: true,default: true},

            {data: 'fasttag_status', name: 'fasttag_status',class:'text-center fasttag_status',title: 'Fasttag Status', orderable: true,default: true},

            {data: 'municipal_tax_status', name: 'municipal_tax_status',class:'text-center municipal_tax_status',title: 'Municipal Tax Status', orderable: true,default: true},

        ];



        (function(window, $) {

            window.LaravelDataTables = window.LaravelDataTables || {};

            window.LaravelDataTables["dataTableBuilder"] = $("#data-table").DataTable({

                processing: true,

                serverSide: true,

                language: {

                    "info": "_START_ - _END_ of _TOTAL_",

                    "lengthMenu": "_MENU_ ",

                    "infoFiltered": ""

                },

                // scrollY: '400px',

                scrollCollapse: true,

                paging: true,

                searching: false,



                bSortCellsTop : true,

                ajax: {

                    url: '{!! route("ObfReportFetch") !!}',

                    method: "POST",

                    data: function (d) {

                        d.booking_date = jQuery(".datatable-form-filter input[name='booking_date']").val();

                        d.branch_name = jQuery(".datatable-form-filter input[name='branch_name']").val();

                        d.customer_name = jQuery(".datatable-form-filter input[name='customer_name']").val();

                        d.gst = jQuery(".datatable-form-filter input[name='gst']").val();

                        d.team_name = jQuery(".datatable-form-filter input[name='team_name']").val();

                        d.sales_person_name = jQuery(".datatable-form-filter input[name='sales_person_name']").val();

                        d.product = jQuery(".datatable-form-filter input[name='product']").val();

                        d.car_varient_name = jQuery(".datatable-form-filter input[name='car_varient_name']").val();

                        d.exterior_color = jQuery(".datatable-form-filter input[name='exterior_color']").val();

                        d.vin_number = jQuery(".datatable-form-filter input[name='vin_number']").val();

                        d.on_road_price = jQuery(".datatable-form-filter input[name='on_road_price']").val();

                        d.booking_amount = jQuery(".datatable-form-filter input[name='booking_amount']").val();

                        d.dp_amount = jQuery(".datatable-form-filter input[name='dp_amount']").val();

                        d.loan_amount = jQuery(".datatable-form-filter input[name='loan_amount']").val();

                        d.net_disbusment = jQuery(".datatable-form-filter input[name='net_disbusment']").val();

                        d.total_exchange_amount = jQuery(".datatable-form-filter input[name='total_exchange_amount']").val();

                        d.final_total = jQuery(".datatable-form-filter input[name='final_total']").val();

                        d.finance_discount = jQuery(".datatable-form-filter input[name='finance_discount']").val();

                        d.net_total = jQuery(".datatable-form-filter input[name='net_total']").val();

                        d.access_sort_amount = jQuery(".datatable-form-filter input[name='access_sort_amount']").val();

                        d.due_amount = jQuery(".datatable-form-filter input[name='due_amount']").val();

                        d.status = jQuery(".datatable-form-filter input[name='status']").val();

                        d.approval_status = jQuery(".datatable-form-filter input[name='approval_status']").val();

                        d.invoice_no = jQuery(".datatable-form-filter input[name='invoice_no']").val();

                        d.invoice_date = jQuery(".datatable-form-filter input[name='invoice_date']").val();

                    },

                    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);



        $("#min").flatpickr({ onSelect: function () { window.LaravelDataTables["dataTableBuilder"].draw(); }, changeMonth: true, changeYear: true });



        $(document).on("change", "#min", function () {

            window.LaravelDataTables["dataTableBuilder"].draw();

        });







    jQuery('.datatable-form-filter input').on('keyup', function (e) {

        if(jQuery(this).val().length >= 3 || e.keyCode == 13 || !jQuery(this).val()) {

            window.LaravelDataTables["dataTableBuilder"].draw();

            e.preventDefault();

        }

    });



    jQuery('.datatable-form-filter select').on('change', function (e) {

        window.LaravelDataTables["dataTableBuilder"].draw();

        e.preventDefault();

    });



    jQuery('input:checkbox[name="name_sort_asc"],input:checkbox[name="name_sort_desc"]').on('click', function (e) {

        window.LaravelDataTables["dataTableBuilder"].draw();

        e.preventDefault();

    });

}); 

</script>

@endsection