
<div class = "col-md-12 col-sm-12">
  <div class= "card " style="height:425px;">
    <div class="card-status bg-yellow">
    </div>
    <div class="card-header">             
     <h3 style="padding-top:15px; padding-bottom:15px;" class="card-title">Cancel Details</h3>
   </div>
   <div class="table-responsive booking-table-height">
    <table class="table table-hover table-outline table-vcenter text-nowrap card-table">
      <thead>
        <tr>
          <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)

        @php($pass_data = [])



       {{-- @php(
        $pass_data = array(
        'id'                  => Crypt::encrypt($rows->id),
        'percentage'          => $rows->percentage,
        'updateamount'        => $rows->amount,
        'description'         => trim($rows->description),
         'name'               => $rows->user->name,
         'user_type'          => $rows->user->type,
        )
        )


        @php($payment = array(

        'installment'      => Crypt::encrypt($rows->id),
        'installment_type' => 'Commission',
        'amount'           => ($rows->amount - $rows->received_amount),
        'description'      => $rows->description,
        'user'             => Crypt::encrypt($rows->user->id),
        'name'             => $rows->user->name,
        'user_type'        => $rows->user->type,
        'payment_type'     => $rows->payment_type,


        ))--}}

        @if($rows->payment_type == "Refund" || $rows->payment_type == "Deduction")

       

        <tr>
     
          <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','Pay Commission']))
                <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>


