<!-- Modal ADD Branch -->
<style>
  .disdiv {
    display: block;
  }
  .hidediv {
    display: none;
  }
</style>
<style>
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
</style>
<div class="modal fade" id="md_add_bill" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  {{ Form::open(array('route' => 'commit_bill', 'id' => 'form_commit_bill', 'class' => 'cls_form' , 'method' => 'POST' , 'enctype'=>'multipart/form-data'
)) }}
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Create Bill and payments</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">

            <div class="col-sm-4">
            <label class="label-color"> Sub-Category: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <select name="subcategory" class="form-control form-control-sm sub-category_list" required id="subcategory">
                @foreach($curr_subategory as $subcategory)
                <option value="{{Crypt::encrypt($subcategory->id)}}">{{$subcategory->name}}</option>
                @endforeach
              </select>
            
             <small class="btn-sm btn-primary" onclick="showModal('form_commit_subcategory','md_add_subcategory')"><i class="fa fa-plus"> </i></small>

            </div>

            </div>
            <div class="col-sm-4">
            <label class="label-color"> Laibility type: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <select name="laibility_type" class="form-control form-control-sm" required id="laibility_type">
                @foreach($laibilitytype as $type)
                <option value="{{$type}}">{{$type}}</option>
                @endforeach
              </select>
            </div>
            </div>

            <div class="col-sm-4">
            <label class="label-color"> Payable type: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <select name="payable_type" class="form-control form-control-sm" required id="payable_type" onchange="payableTypes()">
                @foreach($payabletype as $type1)
                <option value="{{$type1}}">{{$type1}}</option>
                @endforeach
              </select>
            </div>
            </div>

            <div class="col-sm-12 hidediv" id="divlife">

                          
 
             <input type="checkbox" name="life" class="" id="life" onchange="lifecheck()"> <b>Life Time?</b>
             
            </div>

            <div class="col-sm-12">
            <label class="label-color"> Total Amount: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <input type="number" name="total" min="1" onkeyup="numberInWordsValue(this,'amount_into_words')" step="0.01" placeholder="Total Amount" class="form-control form-control-sm " required id="total" onkeypress="return (event.charCode == 8 || event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57"/>
            </div>
            </div>

             <div class="col-sm-12">
            <label class="label-color"> Amount Into Words:</label>
           

            <div class="input-group mb-3">
             
              <input placeholder="Amount In To Words" type="text" readonly="true" class="form-control-sm form-control amount_into_words" >
            </div>
            
          </div>

            <div class="col-sm-12">
            <label class="label-color"> Description: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <input type="text" name="description" class="form-control form-control-sm " required id="description" />
            </div>
            </div>

            <div class="col-sm-12 hidediv" id="divnoofmonth">
            <label class="label-color"> No of Month: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <input type="number" name="noofmonth" class="form-control form-control-sm" min="1" placeholder="No of Months" id="noofmonth" onkeypress="return (event.charCode == 8 || event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57"/>
            </div>
            </div>

            <div class="col-sm-12 hidediv" id="divampermonth">
            <label class="label-color"> Amount per month: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <input type="text" name="ampermonth" class="form-control form-control-sm " disabled  id="ampermonth" />
            </div>
            </div>
           

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

      <div class="modal-footer">
         <input type="hidden" name="category_id" value="{{Crypt::encrypt($category_id)}}">

        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>

        <button type="submit" class="btn btn-primary"   content="create ballot">Create Bill </button>

      </div>
      {{ Form::close() }}
    </div>
  </div>

</div>

<!-- END MODAL ADD BRANCH -->
