<div class="elementFacturationCfg">
  <h3 class="modalTitle">
    Élément de facturation
  </h3>
  <div class="modalBody">
    <div class="factuCfgCommonData">
      <div class="row spbrow">
        <div class="col-xs-12">
          <label class="control-label required">Période</label>
          <select
            class="form-control"
            ng-model="currElementFactu.periode"
            ng-options="o.key as ((o.nom)+' - du '+(o.debut|date)+' au '+(o.fin|date)) for o in periodesCfg.periodes"
            disabled
          ></select>
        </div>
      </div>
      <div class="row spbrow">
        <div class="col-xs-12">
          <label class="control-label required">Nom</label>
          <input
            type="text"
            min="0"
            class="form-control"
            ng-model="currElementFactu.nom"
          />
        </div>
      </div>
      <div class="row spbrow">
        <div class="col-xs-4">
          <label class="control-label">Identifiant</label>
          <i
            class="fa fa-info-circle"
            title="Facultatif - permet d'identifier le service dans le cadre de facturations avancées"
            style="cursor:help;"
          ></i>
          <input
            type="text"
            min="0"
            class="form-control"
            ng-model="currElementFactu.identifiant"
          />
        </div>

        <div class="col-xs-8">
          <label class="control-label">Description</label>
          <textarea
            class="form-control"
            ng-model="currElementFactu.description"
          ></textarea>
        </div>
      </div>
    </div>

    <div class="row spbrow">
      <div class="col-xs-6">
        <label class="control-label required">Prix HT</label>
        <input
          type="number"
          min="0"
          class="form-control"
          ng-model="currElementFactu.prix"
        />
      </div>

      <div
        class="col-xs-6 required"
        ng-class="{'has-error': !currElementFactu.tva && currElementFactu.tva!=0}"
      >
        <label class="control-label">Taux TVA</label>
        <div class="input-group">
          <input
            type="number"
            min="0"
            max="100"
            class="form-control"
            ng-model="currElementFactu.tva"
          />
          <span class="input-group-addon" id="basic-addon2"> % </span>
        </div>
      </div>
    </div>

    <!-- <div class="row spbrow">
                        <div class="col-xs-12">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" ng-model="currElementFactu.subvention"> Éligible à subvention
                                </label>
                            </div>
                        </div>
                    </div> -->

    <hr />
    <div class="row">
      <div class="col-xs-12">
        <!-- TODO passer par un form + required -->
        <button
          type="button"
          class="btn btn-default pull-right"
          ng-disabled="!currElementFactu.nom"
          ng-click="savePeriodeFacturation()"
        >
          Enregistrer
        </button>
      </div>
    </div>
  </div>
</div>
