 <div class="table-responsive">
  <table id="example" class="table table-bordered align-middle" style="width:100%">
    <thead class="table-light">
      <tr>
        <th>Sl No</th>
        <th>Module Type</th>
        <th>Prefix</th>
        <th>Startfrom</th>
        <th>Finacial Year</th>
        @if(in_array('invoice-serial-setting-edit', $authRolePermissions))
        <th class="thbutton">Edit</th>
        @endif
        @if(in_array('invoice-serial-setting-delete', $authRolePermissions))
        <th class="thbutton">Delete</th>
        @endif
    </tr>
</thead>
<tbody>
    @php $i=1;@endphp
    @if(count($InvoiceSerialSetting)>0)
    @foreach($InvoiceSerialSetting as $key=> $row)
    <tr>
        <td>{{$InvoiceSerialSetting->firstItem() + $key}}</td>
        <td>{{$row->module_type}}</td>
        <td>{{$row->prefix}}</td>
        <td>{{$row->startfrom}}</td>
        <td>@if(isset($row->getFinancialYear->financial_year_name)){{$row->getFinancialYear->financial_year_name}}@endif</td>
        @if(in_array('invoice-serial-setting-edit', $authRolePermissions))
        <td>
            <a href="{{route('invoice-setting.edit',$row->id)}}" class="btn btn-warning" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Edit">
                <i class="bi bi-pencil-square text-white"></i>
            </a>
        </td>
        @endif
        @if(in_array('invoice-serial-setting-delete', $authRolePermissions))
        <td>
            <a data-url="{{route('invoice-setting.delete')}}" data-id="{{$row->id}}" class="btn btn-danger deleteData" class="text-danger" 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 align="center">
        <td colspan="7"><b>No Data Found</b></td>
    </tr>
    @endif
</tbody>
</table>
</div>
<nav class="float-start mt-2">
    <ul class="pagination">
        {!! $InvoiceSerialSetting->onEachSide(1)->render('invoice-serial-setting.pagination') !!}
    </ul>
</nav>
</div>

