@php($label_list = EF::getWhiteLabel())
<div class="modal fade" id="md_pay_payable" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  {{ Form::open(array('route' => 'pay.payable', 'class' => 'cls_form', 'id' => 'form_pay_payable')) }}
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Pay Payable</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>
      <div class="modal-body">
        <div class = "card">
          <div class = "row">
                <div class="col-sm-6">
              <label class="label-color">Total Amount: <i style = "color:red;"></i></label>
          
            <div class="input-group mb-3">
          
              {{Form::number('total_amount', '', ['class' => 'form-control form-control-sm cls_required total_amount', 'placeholder' => 'Total Payable Amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','readonly'=>'true'])}}
                 
            </div>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('total_amount',":message") }}</small>
          </div>
               <div class="col-sm-6">
              <label class="label-color">Received Amount: <i style = "color:red;"></i></label>
           
            <div class="input-group mb-3">
          
              {{Form::number('received_amount', '', ['class' => 'form-control form-control-sm cls_required received_amount', 'placeholder' => 'Total Received Amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','readonly'=>'true'])}}
               
            </div>
             <small class="form-errors pull-right req" value="*">{{ $errors->first('received_amount',":message") }}</small>
          </div>
                   <div class="col-sm-4">
              <label class="label-color">Payable Amount: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
          
              {{Form::text('payable_amount', '', ['class' => 'form-control form-control-sm cls_required amount', 'placeholder' => 'Amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','min'=>'1','onkeyup' => 'numberInWordsValue(this,"amount_in_words"); checkPayableAmount(event,this);','id'=>'amount'])}}

            
            </div>
             <small class="form-errors pull-right req" value="*">{{ $errors->first('payable_amount',":message") }}</small>
          </div>
               <div class="col-sm-8">
                     <label class="label-color">Amount In Words  </label>
                  <small class="form-errors pull-right req" value="">{{ $errors->first('amount_in_words',":message") }}</small>
                   <div class="input-group mb-3">
             
              <input placeholder="Amount In  Words" type="text" name= "amount_in_words" readonly="" class="form-control-sm form-control amount_in_words" >
            </div>
          </div>

          </div>

          <div class = "row">

                 <div class="col-sm-12">
               <label class="label-color">{{ucwords(str_replace('_',' ',$label_list['payment_mode']))}}:</label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first($label_list['payment_mode'],":message") }}</small>

            <div class="input-group mb-3">
            
              @php($mode_list = [])

              @foreach(EF::getPaymentMode() as $rows)
                @php($mode_list += [$rows => $rows])
              @endforeach

             {{Form::select($label_list['payment_mode'], $mode_list, '' , array('class' => 'form-control form-control-sm  form-control form-control-sm -sm  cls_selection','onChange' => 'checkPaymentMode(this,"bank_section")'))}}
            </div>    
          </div>
        </div>
                    <div class ="bank_section row" style="display:none;">

          <div class="col-sm-4">
               <label class="label-color">Drawn On:</label>
            <small class="form-errors pull-right req" value="">{{ $errors->first('drawn_on',":message") }}</small>

            <div class="input-group mb-3">
              
                 <select class = "form-control form-control-sm" name = "drawn_on"><option value = "{{Crypt::encrypt(0)}}">Select Bank</option>
              @foreach($curr_accounts as $rows)

              <option value = "{{Crypt::encrypt($rows->id)}}">{{ucwords($rows->name)}}</option>

              @endforeach

            </select>
            </div>   
          </div>

           <div class="col-sm-4">
               <label class="label-color">Instrument:</label>
            <small class="form-errors pull-right req" value="">{{ $errors->first('instrument',":message") }}</small>

            <div class="input-group mb-3">
         
              {{Form::Text('instrument', '', ['class' => 'form-control form-control-sm  form-control form-control-sm -sm  cls_required', 'placeholder' => 'Cheque # ' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>   
          </div>
            <div class="col-sm-4">
                 <label class="label-color">Instrument Date:</label>
            <small class="form-errors pull-right req" value="">{{ $errors->first('instument_date',":message") }}</small>

            <div class="input-group mb-3">
             
              {{Form::Date('instrument_date', '', ['class' => 'form-control form-control-sm  form-control form-control-sm -sm  cls_date' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default'])}}
            </div>    
          </div>


    
          </div>
      
      
      </div>
    </div>
    <input type = "hidden" name= "payable" />
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
      <button type="submit" class="btn btn-primary cls_submit" content="pay payable">Pay</button>
      </div>
    </div>
  </div>
  {{ Form::close() }}
</div>