 @extends('adminlte::page') @section('content')
<?php Fun::lang()?>
    <div class="title-page">
        <div class="page-bar">
            <ul class="page-breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
                <li><a href="#">Accounting</a></li>
                <li><a href="#">Expense</a></li>
            </ul>
        </div>
    </div>
    <div class="page">
        <div class="top-content">
            <div class="row">
                <div class="col-sm-12 col-xs-12">
                    <div class="title-add">
                        <div class="pull-left">
                            <h3>Expense</h3>
                        </div>
                    </div>
                    <div class="pull-right">
                        <a class="button_sm button_primary" href="{{route('accouting-expense.create')}}"><span class="fa fa-plus"></span>  Create New</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-body table-responsive">
            <table id="datatable_accounting_expense" class="table table-striped table-bordered table-hover nowrap">
                <thead>
                    <tr>
                        <th>No</th>
                        <th>Date</th>
                        <th>Code</th>
                        <th>Title</th>
                        <th>Pay For</th>
                        <th>Supplier</th>
                        <th>Reference</th>
                        <th>Description</th>
                        <th>Invoice</th>
                        <th>User By</th>
                        <th>Amount</th>
                        <th>Action</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>

    @endsection @section('js')

    <script type="text/javascript">
        $(document).ready(function() {
            $('.main-spinner').show();
            $('#datatable_accounting_expense').DataTable({
                "lengthMenu": [
                    [20, 25, 50, 100, 500],
                    [20, 25, 50, 100, 500]
                ],
                ordering: false,
                serverSide: true,
                ajax: "{{ route('datatable.get_expense_list') }}",
                columns: [
                    {data: 'DT_RowIndex',"searchable": false},
                    {data: 'do_date',"searchable": false},
                    {data: 'expense_code','name':'nso007_account_chart.id'},
                    {data: 'expense_title','name':'nso007_account_chart.acc_name'},
                    {data: 'expense_for','name':'nso007_project_stock.project_name'},
                    {data: 'supplier_name','name':'nso007_supplier.supplier_name'},
                    {data: 'expense_to','name':'nso007_journal.journal_referenceid'},
                    {data: 'expense_des','name':'nso007_journal.journal_des'},
                    {data: 'expense_invoice','name':'nso007_journal.journal_invoice'},
                    {data: 'user_by',"searchable": false},
                    {data: 'expense_amount',"searchable": false},
                    {data: 'action',"searchable": false},
                ],
                "initComplete": function(settings, json) {
                    $('.main-spinner').hide();
                }
            });

            $.fn.dataTable.ext.errMode = 'throw';
        });
    </script>
    @endsection