<div class="row">
  {{--
<div class="col-sm-6">
      <small class="form-errors pull-right req" value="*">{{ $errors->first($convention.'_head',":message") }}</small>

      <div class="input-group mb-3">
        <div class="input-group-prepend">
          <span class="input-group-text" id="inputGroup-sizing-default">
            Head
          </span>
        </div>

        <select name="{{$convention}}_head[]"  class="form-control form-control-sm cls_selection" onchange="getSubheadByHead(this,'{{$unique_id}}','{{$convention}}')">
          <option value="{{Crypt::encrypt(0)}}">Select {{ucfirst($convention)}} Head</option>
          @isset($head_list)
            @foreach($head_list as $rows)
              <option @isset($account->id) @if($account->head_id == $rows->id) selected @endif   @endisset value="{{Crypt::encrypt($rows->id)}}">{{$rows->name}}</option>
            @endforeach
          @endisset
       
        </select>

      </div>
  </div>
  --}}
  <div class="col-sm-12">
      <small class="form-errors pull-right req" value="*">{{ $errors->first($convention.'_subhead',":message") }}</small>

      <div class="input-group mb-3">
        
        <select content="{{$convention}}_subhead_{{$unique_id}}" name="{{$convention}}_subhead[]" id="{{$convention}}_subhead_{{$unique_id}}" class="{{$convention}}_subhead_{{$unique_id}} form-control form-control-sm cls_selection fstdropdown-select {{$convention}}_subhead_list">
          <option value="{{Crypt::encrypt(0)}}">Select SubHead</option>


          @if(isset($subhead_list) && isset($filter_subhead_list))

            <!-- VOUCHER FILTRATION -->
            @if(isset($voucher_type))

                <!-- RECEIPT VOUCHER -->
                @if(in_array($voucher_type,['CRV','BRV']) && $convention === "debit")
                  <!-- SKIP FOR DEBIT CAHS AND BANK ACCOUNT ACCORDING TO VOUCHER TYPE -->
                  @foreach($filter_subhead_list as $rows)
                    <option @isset($account->id) @if($account->id == $rows->id) selected @endif   @endisset  value="{{Crypt::encrypt($rows->id)}}">{{$rows->head->code}} {{$rows->head->name}} | {{$rows->code}} {{$rows->name}}</option>
                  @endforeach
           
                <!-- PAYMENT VOUCHER -->
                @elseif(in_array($voucher_type,['CPV','BPV']) && $convention === "credit")
                  <!-- SKIP FOR CREDIT CAHS AND BANK ACCOUNT ACCORDING TO VOUCHER TYPE -->
                  @foreach($filter_subhead_list as $rows)
                    <option @isset($account->id) @if($account->id == $rows->id) selected @endif   @endisset  value="{{Crypt::encrypt($rows->id)}}">{{$rows->head->code}} {{$rows->head->name}} | {{$rows->code}} {{$rows->name}}</option>
                  @endforeach

                @else
                  <!-- SHOW ALL ACCOUNT ACCORDING TO VOUCHER TYPE -->
                  @foreach($subhead_list as $rows)
                    <option @isset($account->id) @if($account->id == $rows->id) selected @endif   @endisset  value="{{Crypt::encrypt($rows->id)}}">{{$rows->head->code}} {{$rows->head->name}} | {{$rows->code}} {{$rows->name}}</option>
                  @endforeach

                @endif
            @else
                  <!-- SHOW ALL ACCOUNT ACCORDING TO VOUCHER TYPE -->
                  @foreach($subhead_list as $rows)
                    <option @isset($account->id) @if($account->id == $rows->id) selected @endif   @endisset  value="{{Crypt::encrypt($rows->id)}}">{{$rows->head->code}} {{$rows->head->name}} | {{$rows->code}} {{$rows->name}}</option>
                  @endforeach
            @endif

          @endif

         
          

        </select>

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

<script type="text/javascript">
  setFstDropdown();
</script>