<div class="table-responsive">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                <th class="thbutton">Sl No</th>
                <th>Name</th>
                {{--<th>Voucher Master</th>--}}
                <th class="text-center">Master Settings</th>
                <th class="text-center">Serial Setup</th>
                <th class="text-center">Clearance</th>
                <th class="text-center">Letter Head</th>
                @if(in_array('voucher-type-terms-list', $authRolePermissions))
                <th>Terms</th>
                @endif
                <th class="thbutton">Default</th>
                <th class="thbutton">Status</th>
                <th class="thbutton">Tax Applicable</th>
                <th class="thbutton">Show HSN</th>
                @if(in_array('voucher-types-edit', $authRolePermissions))
                <th class="thbutton">Edit</th>
                @endif
                @if(in_array('voucher-types-delete', $authRolePermissions))
                <th class="thbutton">Delete</th>
                @endif
            </tr>
        </thead>
        <tbody>
            @php $i=1;@endphp
            @if(count($data)>0)
                @foreach($data as $key=> $list)
                    <tr>
                        <td>{{$data->firstItem() + $key}}</td>
                        <td>
                            <strong>{{$list->name}} </strong><br>
                            {{$list->voucher_title ?? ''}} <span class="badge badge-primary bg-secondary">{{$list->default_price_type}}</span>
                        </td>
                        {{--<td>
                            <strong> </strong><br>
                            {{$list->voucher_title ?? ''}}
                        </td>--}}

                        <td class="text-center">
                            <a class="btn btn-secondary button-large text-white" href="{!! route('voucher-master-settings', ['id' => $id, 'type_id' => $list->id]) !!}">
                                Settings
                            </a>
                        </td>

                        <td class="text-center">
                            <a class="btn btn-secondary button-large text-white" href="{!! route('voucher-series.index') !!}?redirect-back=voucher-master-types&master={{$id}}&search={{$list->name}}">
                                Settings
                            </a>
                        </td>

                        <td class="text-center">
                            <a class="btn btn-secondary button-large text-white" href="{!! route('clearance-settings.index' , $list->id) !!}">
                                Settings
                            </a>
                        </td>

                        <td class="text-center">
                            <a data-url="{{route('voucher-types.edit-letterhead',$list->id)}}" class="btn btn-secondary button-large text-white edit-letterhead" href="#" data-bs-toggle="modal" data-bs-target="#commonModal" title="Edit">
                                Settings
                            </a>
                        </td>

                        @if(in_array('voucher-type-terms-list', $authRolePermissions))
                            <td class="text-center">
                                <a class="btn btn-outline-primary button-large text-white" href="{!! route('voucher-type-terms.index', $list->id) !!}">
                                    <i class="bi bi-file-text-fill" style="font-size: 17px;"></i>
                                </a>
                            </td>
                        @endif
                        <td>
                            <div class="form-check form-check-inline{{$i}}">
                                <input class="form-check-input{{$i}} btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('voucher-types.changedefault')}}" data-id="{{$list->id}}" data-status="{{$list->is_default=='0' ? '1' : '0'}}" {{ $list->is_default=='1' ? 'checked' : ''}}>
                            </div>
                        </td>
                        <td>
                            <div class="form-check form-check-inline{{$i}}">
                                <input class="form-check-input{{$i}} btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('voucher-types.changestatus')}}" data-id="{{$list->id}}" data-status="{{$list->status=='0' ? '1' : '0'}}" {{ $list->status=='1' ? 'checked' : ''}}>
                            </div>
                        </td>
                        <td class="text-center">
                            <div class="form-check form-check-inline{{$i}}">
                                <input class="form-check-input{{$i}} btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('voucher-types.change-tax-applicable')}}" data-id="{{$list->id}}" data-status="{{$list->tax_applicable=='0' ? '1' : '0'}}" {{ $list->tax_applicable=='1' ? 'checked' : ''}}>
                            </div>
                        </td>
                        <td>
                            <div class="form-check form-check-inline{{$i}}">
                                <input class="form-check-input{{$i}} btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('voucher-types.change-show-hsn')}}" data-id="{{$list->id}}" data-status="{{$list->show_hsn=='0' ? '1' : '0'}}" {{ $list->show_hsn=='1' ? 'checked' : ''}}>
                            </div>
                        </td>
                        @if(in_array('voucher-types-edit', $authRolePermissions))
                        <td align="center">
                            <button data-id="{{ $list->id }}" class="btn btn-warning voucher-types edit" data-bs-toggle="modal" data-bs-target="#commonModal" title="Edit">
                                <i class="bi bi-pencil-square text-white"></i>
                            </button>
                        </td>
                        @endif
                        @if(in_array('voucher-types-delete', $authRolePermissions))
                        <td align="center">
                            <a data-url="{{route('voucher-types.destroy')}}" data-id="{{$list->id}}" class="btn btn-danger deleteDataCustom" href="#" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
                                <i class="bi bi-trash text-white"></i>
                            </a>
                        </td>
                        @endif
                    </tr>
                    @php $i++; @endphp
                @endforeach
            @else
                <tr>
                    <td colspan="8">No Data Found</td>
                </tr>
            @endif
        </tbody>
    </table>
</div>
<nav class="float-start mt-2">
    <ul class="pagination">
        {!! $data->onEachSide(0)->render('voucher-types.pagination') !!}
    </ul>
</nav>
</div>

