
   
                    <?php

                    use Carbon\Carbon; ?>
                    @foreach($filterResult as $list)
                    @php
                    $startDate = Carbon::parse($list->issue_date);
                    $endDate = Carbon::parse(date('Y-m-d'));
                    // Calculate the number of days between the two dates
                    $numberOfDays = $startDate->diffInDays($endDate);
                    @endphp
                    <tr>
                        <td><input type="checkbox" class="checkbox" name="book_issue_id[]" value="@if(isset($list->id)){{$list->id}}@endif"></td>
                        <td>@if(isset($list->short_name))@php echo wordwrap($list->short_name,25,"<br>\n") @endphp@endif <br>
                            <b>No.of Day's</b>: {{$numberOfDays}}<br>
                            <b>Issue Date</b>: @if(isset($list->issue_date)){{$list->issue_date}}@endif <br>
                            <b>Return Date</b>: @if(isset($list->return_due_date)){{$list->return_due_date}}@endif
                        </td>
                        <td>
                            <input type="hidden" class="issue_qty form-control" id="issue_qty{{$list->id}}" value="@if(isset($list->qnt)){{$list->qnt}}@endif">
                            <input type="text" name="qnt[]" class="return_qty form-control" id="return_qty{{$list->id}}" value="@if(isset($list->qnt)){{$list->qnt}}@endif" data-id="{{$list->id}}" required>
                        </td>
                        <td>
                            <input type="text" name="damageqnt[]" value="0" class="damage_qty form-control" data-id="{{$list->id}}" id="damageqty{{$list->id}}" readonly>
                        </td>
                        <td>
                            <input type="text" name="damage_amount[]" value="0" class="damage_amount form-control" data-id="{{$list->id}}" id="damage_amount{{$list->id}}" readonly>
                        </td>
                        <td>
                            <div class="form-check form-switch">
                                <input class="form-check-input changetoDamage btn-lg" type="checkbox" role="switch" id="flexSwitchCheckDefault" data-id="{{$list->id}}" name="book_issue_damage[]">
                            </div>
                        </td>
                    </tr>
                    @endforeach
            