   <div class="table-responsive ">
    <table class="table table-sm table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
      <thead>
        <tr>

          <th>Sr #</th>
          <th>{{ucwords(str_replace('_',' ',EF::branchWhiteLabel()['module']))}}</th>
          <th>Payment Detail</th>
          <th>Description</th>
          <th>Amount</th>
          <th>Payment Type</th>
          <th>status</th> 
          <th>Date</th>   
         
          <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>                          
        </tr>
      </thead>
      <tbody>
        @isset($payment_list)
        @foreach($payment_list as $rows)

        @php($other_info = $rows->showGenericTypeDetail($rows))

                      
        
        <tr>
          <td>{{$loop->iteration}}</td>
          <td>{{$rows->branch->name}}</td>

          <td>{{$other_info['description']}}</td>

         <td>{!!wordwrap($rows->description,50,'<br>')!!} </td>

          <td>{{EF::numberFormat($rows->amount)}}</td>
          <td>{{$rows->payment_type}}</td>
          <td>
             @if($rows->status == "Approve") 
                <span class="badge badge-success">{{EF::getstatus($rows->status)}}</span>
              @elseif($rows->status == "Unapprove") 
                <span class="badge badge-primary">{{EF::getstatus($rows->status)}}</span>
              @else
                <span class="badge badge-warning"> {{$rows->status}}</span>
              @endif
          </td>
          
          <td>{{EF::dateFormat($rows->created_at)}}</td>


           <td class="text-center"> 
              <div class="item-action dropdown">
              <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fa fa-list-ul"></i></a>
                <div class="dropdown-menu dropdown-menu-right">

                  @php($voucher_type = 'receipt')

             @if(Auth::user()->hasAnyPermission(['All','Create Voucher'])) 
                   @if($rows->status == "Unapprove")
                      <a href="#" id="pay" class="dropdown-item" data-target="#md_add_voucher" data-toggle="modal" onclick="showpaymentvoucherModel(event,'{{Crypt::encrypt($rows->id)}}','{{Crypt::encrypt($voucher_type)}}')"><i class="dropdown-icon fa fa-edit"   ></i>Create Voucher  </a>
                      @endif
                      @endif
                    
                  @if(Auth::user()->hasAnyPermission(['All','Update Payment'])) 
                  @if($rows->status == "Unapprove")
                   <a href="#" id="pay" class="dropdown-item" onclick="showUpdatePayPaymentModel(event,'{{Crypt::encrypt($rows->id)}}');" ><i class="dropdown-icon fa fa-edit"   ></i>Update  </a>
                   @endif
                   @endif

                  @if(Auth::user()->hasAnyPermission(['All','Remove Payment']))  
                  @if($rows->status == "Unapprove") 
                   <a href="{{route('payment.trash',['id' => Crypt::encrypt($rows->id)])}}" content ="remove payment" class="dropdown-item  cls_delete"><i class="dropdown-icon  fa fa-trash"></i> Remove </a>
                   @endif
                   @endif

                   @if(Auth::user()->hasAnyPermission(['All','View Booking Receipts']) && $rows->generic_type_id != EF::getGenericTableIndex()['Inventory Payable']) 
                   <a target="_blank" href="{{route('document.paymentreceipt',['id' => Crypt::encrypt($rows->id)])}}" content ="remove payment" class="dropdown-item "><i class="dropdown-icon  fa fa-print"></i> Receipt </a>
                   @endif
                </div>
            </div>
          </td>
       </tr>
      
       @endforeach
       @endisset
     </tbody>
   </table>
 </div>  