@extends('adminlte::page')

@section('content')
    <?php Fun::lang()?>
    <div class="top-header">
        <ol class="breadcrumb">
            <li><a href="#">{{__('administrator.Dashboard')}}</a></li>
            <li><a href="{{route('hr-employee.index')}}">{{__('administrator.generate-salary')}}</a></li>
        </ol>
    </div>
    <div class="page">
        <div class="top-content">
            <div class="row">
                <div class="col-sm-6 col-xs-12">
                    <div class="title-add">
                        <div class="pull-left">
                            <h3>{{__('administrator.generate-salary')}} </h3>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6 col-xs-12">
                    <div class="title-add">
                        <div class="pull-right">
                            @can('Generate-Salary-Create')
                            <a href="{{route('hr-generate-salary.create')}}" class="button_primary">{{__('administrator.add_new')}}</a>
                            @endcan
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-body">
            <table id="datatables" width="100%" class="table table-striped">
                <thead>
                <tr>
                    <th>#</th>
                    <th>{{__('administrator.employee')}}</th>
                    <th>{{__('administrator.child')}}</th>
                    <th>{{__('administrator.spouse')}}</th>
                    <th>{{__('administrator.month')}}</th>
                    <th>{{__('administrator.year')}}</th>
                    <th>{{__('administrator.monthly_rate')}}</th>
                    <th>{{__('administrator.gross_pay')}}</th>
                    <th>{{__('administrator.income_tax')}}</th>
                    <th>{{__('administrator.taxable_salary')}}</th>
                    <th>{{__('administrator.net_pay')}}</th>
                    <th>{{__('administrator.action')}}</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
        </div>
    </div>
    
@endsection
@section('js')
    <script type="text/javascript">
        $(document).ready(function () {
            
            $('#datatables').DataTable({
                ordering: true,
                serverSide: true,
                ajax: "{{ route('datatable.hr-gen-salary') }}",
                columns:
                    [
                        {data: 'DT_RowIndex'},
                        {data: 'emp_id'},
                        {data: 'child'},
                        {data: 'spouse'},
                        {data: 'f_month'},
                        {data: 'f_year'},
                        {data: 'monthly_rate'},
                        {data: 'gross_pay'},
                        {data: 'income_tax'},
                        {data: 'taxable_salary'},
                        {data: 'net_pay'},
                        {data: 'action'},
                    ],
                "initComplete": function (settings, json) {
                }
            });
            $.fn.dataTable.ext.errMode = 'throw';
        });
    </script>
@endsection
