@extends('clientarea.app')
@section('content')
<div class="col-md-12 content-header" >
    <h1><i class="fa fa-money"></i> {{trans('application.payments')}}</h1>
</div>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-body">
                    <div class="table-responsive">
                    <table class="table table-bordered table-striped table-hover ajax_datatable">
                        <thead>
                        <tr>
                            <th>{{trans('application.invoice_number')}}</th>
                            <th>{{trans('application.date')}}</th>
                            <th>{{trans('application.payment_method')}}</th>
                            <th>{{trans('application.notes')}}</th>
                            <th class="text-right">{{trans('application.amount')}}</th>
                        </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
@endsection
@section('scripts')
    <script type="text/javascript">
        $(document).ready(function() {
            $('.ajax_datatable').DataTable({
                processing: true,
                serverSide: true,
                stateSave: true,
                ajax: '{{route('cpayments.index')}}',
                order: [],
                columnDefs: [{
                    "orderable": false,
                    "targets": 0
                }],
                oLanguage: {
                    "sProcessing":"{{trans('application.processing')}}"
                },
                columns:[
                    {data: 'number',name:'invoices.number',orderable:false},
                    {data: 'payment_date',orderable:false},
                    {data: 'payment_method',orderable:false},
                    {data: 'notes',orderable:false},
                    {data: 'amount', 'searchable':false,className: "text-right",orderable:false}
                ]
            });
            $('div.dataTables_filter input').addClass('form-control input-sm');
            $('div.dataTables_length select').addClass('form-control input-sm');
        });
    </script>
@endsection

