<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 class="thbutton">Booking No</th>
                <th>Consignor</th>
                <th>Consignee</th>
                <th>From Via to</th>
                <th>Payment</th>
                <th>Amount</th>
                <th>DUE.</th>
                <th>REC.</th>
                <th>DIS.</th>
                <th>Location</th>
                <th>Invoice No</th>
                <th>Status</th>
                <th>Print</th>
                <th>Collect</th>
                <th>Edit</th>
            </tr>
        </thead>
        <tbody>
            @php $i=1;@endphp
            @if(count($data)>0)
                @foreach($data as $key=> $list)
                    <tr>
                        <td class="text-center">{{$data->firstItem() + $key}}</td>
                        <td><a class="" href="{{route('booking-register.show',$list->id)}}">{{$list->main_booking_no}}</a></td>
                        <td>{{$list->consignor}}</td>
                        <td>{{$list->consignee}}</td>
                        <td>{{$list->from_location}}  <br/>{{$list->transportation_mode}} <br/> {{$list->to_location}} </td>
                        <td>{{$list->payment_term}}</td>
                        <td>{{ ($list->total_amount ?? 0) + ($list->charge_amount ?? 0) + ($list->consignor_invoice_value ?? 0) }}</td>
                        <td>{{$list->due_amount ?? '0'}}</td>
                        <td>{{$list->rec ?? '0'}}</td>
                        <td>{{$list->discount ?? '0'}} </td>
                        <td>{{$list->from_location}}</td>
                        <td>{{$list->if_decrease}}</td>
                        <td>{{$list->booking_status}}</td>
                         <td style="text-align:center" class="pt-3">
                    <a class="btn btn-primary text-center" href="{{route('printbooking',$list->id)}}"><i class="bi bi-printer text-white"></i></a>
                </td>
                        <td  class="text-center pt-3"><button  class="btn btn-success  text-center" style="height: 30px ; width: 50px;" >Collect</button></td>
               <td class="pt-3  text-center" >
                    <a class="btn btn-warning text-center" href="{{route('booking-register.edit',$list->id)}}"><i class="bi bi-pencil-square text-white"></i></a>
                 </td>
                    </tr>
                    @php $i++; @endphp
                @endforeach
            @else
                <tr>
                    <td colspan="5">No Data Found</td>
                </tr>
            @endif
        </tbody>
    </table>
</div>
<nav class="float-start mt-2">
    <ul class="pagination">
        {!! $data->onEachSide(0)->render('accounting-types.pagination') !!}
    </ul>
</nav>
</div>

