<!-- Modal ADD Deduction -->
@php($unique_id = "add_deduction")
<div class="modal fade" id="md_add_deduction" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
@if(EF::getUrl() == "deduction")
  {{ Form::open(array('route' => 'deduction.store', 'class' => 'cls_form','id'=>'form_add_deduction')) }}

  @else
  {{ Form::open(array('route' => 'payrolldeduction.store', 'class' => 'cls_form','id'=>'form_add_deduction')) }}

  @endif

  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Deduction</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 ="card-body form-fieldset">
        <div class="row">

@if(EF::getUrl() != "deduction")
          <div class="col-sm-12">
              <label class="label-color"> Select Deduction : </label>
            <small class="form-errors pull-right" value="">{{ $errors->first('deduction_title',":message") }}</small>

            <div class="input-group mb-3">
              <select name="deduction_title" class="form-control form-control-sm cls_selection type_list" onChange = "getDeduction(event,this)">
                  <option value="{{Crypt::encrypt(0)}}">Select Deduction </option>

                 @foreach($titles as $rows)
                 <option value="{{Crypt::encrypt($rows->id)}}">{{$rows->title}}
                 </option>

                 @endforeach
        
                </select>
            </div>
          </div>
          @endif

            <div class="col-sm-12">
              <label class="label-color"> Title : <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('title',":message") }}</small>
            <div class="input-group mb-3">
            <input type="text" name="title" class="form-control form-control-sm title cls_required ">
          </div>
          </div>

          <div class="col-sm-4">
              <label class="label-color"> Amount : <i style = "color:red;">*</i></label>
            <small class="form-errors pull-right req" value="*">{{ $errors->first('amount',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::number('amount', '', ['class' => 'form-control form-control-sm cls_required deduction_amount amount_'.$unique_id.' ', 'placeholder' => 'Amount' ,'id' => 'amount' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default', 'onchange'=>'netAmount(event,"'.$unique_id.'")'])}}
            </div>
          </div>
          
          <div class="col-sm-8">
              <label class="label-color"> Amount In Words : </label>
            <small class="form-errors pull-right" value="">{{ $errors->first('amount_in_words',":message") }}</small>

            <div class="input-group mb-3">
              {{Form::Text('amount_in_words', '', ['class' => 'form-control form-control-sm deduction_amount_in_words amount_in_words_'.$unique_id.' ', 'placeholder' => ' Amount In Words' , 'aria-label' => 'Default', 'aria-describedby' => 'inputGroup-sizing-default','readonly' => 'true'])}}
            </div>
          </div>



          </div>

          

          

          
         </div>

          </div>
        </div>
       
   <input type = "hidden" name = "user_id" class = "user" />

   <input type = "hidden" name = "minute_id" class = minute />

   <input type = "hidden" name = "deduction" class = "deduction"/>

        
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="submit"  class="btn btn-primary @if(EF::getUrl() == 'deduction') cls_submit @endif" onClick="storeDeduction(event,this)" content="add deduction">Add Deduction</button>
      </div>
    </div>
  </div>
  {{ Form::close() }}
</div>
<!-- END MODAL ADD BANK -->