<?php use Carbon\Carbon;?>
@foreach($bookReturn as $key=> $list)

@php 


    $startDate = Carbon::parse($list->getIssuedetails->getisseuBook->issue_date);
    
    $endDate = Carbon::parse($list->return_date);
  
// Calculate the number of days between the two dates
$numberOfDays = $startDate->diffInDays($endDate);
@endphp
  @php $key++; @endphp
  <tr>
      <td><input type="checkbox" class="checkbox" checked name="book_issue_id[]" value="@if(isset($list->book_issue_detail_id)){{$list->book_issue_detail_id}}@endif"></td>
      <td>@if(isset($list->getIssuedetails->book->short_name))@php echo wordwrap($list->getIssuedetails->book->short_name,25,"<br>\n") @endphp@endif <br>
      <b>Issue Date</b>: @if(isset($list->getIssuedetails->getisseuBook->issue_date)){{$list->getIssuedetails->getisseuBook->issue_date}}@endif <br>
      <b>Return Date</b>: @if(isset($list->return_date)){{$list->return_date}}@endif
      </td>
      <td>
      <input type="hidden" class="issue_qty form-control" id="issue_qty{{$list->id}}" value="@if(isset($list->getIssuedetails->qnt)){{$list->getIssuedetails->qnt}}@endif">
      <input type="text" name="qnt[]" class="return_qty form-control" id="return_qty{{$list->id}}" value="@if(isset($list->return_qty)){{$list->return_qty}}@endif" data-id="{{$list->id}}" required>
    </td>
    <td>
      <input type="text" name="damageqnt[]" value="@if(isset($list->damage_qty)){{$list->damage_qty}}@endif" class="damage_qty form-control" data-id="{{$list->id}}" id="damageqty{{$list->id}}" readonly>
    </td>
    <td>
      <input type="text" name="damage_amount[]" value="@if(isset($list->amount)){{$list->amount}}@endif" class="damage_amount form-control" data-id="{{$list->id}}" id="damage_amount{{$list->id}}" readonly>
    </td>
    <td>
      <div class="form-check form-switch" id="">
        <input class="form-check-input changetoDamage btn-lg" type="checkbox" role="switch" id="flexSwitchCheckDefault" data-id="{{$list->id}}" @if($list->damage_status==1){{'checked'}}@endif  name="book_issue_damage[]">
      </div>
    </td>
      <td>
          <a  class="btn btn-danger btn-sm deletebookData text-white" data-bs-toggle="tooltip" data-id="{{$key}}"  data-url="{{ route('delete-return-book-item') }}" data-mainid="{{$list->book_issue_detail_id}}" ><i class="bi bi-trash"></i></a>
      </td>
  </tr>
@endforeach