@if(Auth::user()->hasAnyPermission(['All','View Transfer Booking']))

<div class = "col-md-12 col-sm-12">
  <div class= "card card-collapsed">
    <div class="card-status bg-pink">
    </div>
    <div class="card-header">             

    
 

     <h3 class="card-title">Transfer</h3>

     <div class="card-options">
       <a onclick="cardCollapseOnce(event,this);" href="#" class="card-options-collapse btn btn-sm btn-outline-primary" >View <i class="fe fe-chevron-up"></i></a>

     </div>


   </div>
   <!-- <div class="alert alert-primary card-alert mb-0">
     Transfer
   </div> -->

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

          <th>Sr #</th>
          <th>Name</th>
          <th>Description</th>
          <th>Amount</th>
          <th>Received</th> 
          <th>Balance</th>   


          <th>Status</th>
          <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>                          
        </tr>
      </thead>
      <tbody>
        @isset($commission_list)
        @foreach($commission_list as $rows)

   

        @if($rows->payment_type == "Transfer")
        <tr>
          <td>{{$loop->iteration}}</td>
          <td>{{ucfirst($rows->user->name)}} ({{$rows->commission_type}})</td>

          <td>{{$rows->description}}</td>
          <td>{{EF::numberformat($rows->amount)}}</td>
          <td>{{EF::numberformat($rows->received_amount)}}</td>
          <td>{{EF::numberformat($rows->amount - $rows->received_amount)}}</td>


          <td>{{$rows->status}}</td>
          <td class="text-center"> 
            @if($rows->status == 'Unpaid')
            <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">
             
               @if(Auth::user()->hasAnyPermission(['All','Add Payment']) && $rows->amount > 0)
               <a href="#" id="pay" class="dropdown-item" onclick="showPayPaymentModel(event,'{{Crypt::encrypt(EF::getGenericTableIndex()['Commission'])}}','{{Crypt::encrypt($rows->id)}}')"><i class="dropdown-icon fa fa-money"   ></i> Pay </a>
               @endif
               
          
             </div>
           </div>
           @endif


         </td>

       </tr>
       @endif
       @endforeach
       @endisset
     </tbody>
   </table>
 </div>                               


</div>
</div>
@endif