<commit_before><form method="post" name="form" novalidate ng-submit="submit(form)">
  <div class="modal-header">
    <h1 class="modal-title">Vos ressources</h1>
  </div>
  <div class="modal-body" ng-switch on="tab">
    <div ng-switch-when="ressources">
      <p>
        Cliquez sur les types de ressources que les personnes de votre foyer ont perçues
        <strong>entre {{ debutAnnee }} et {{ finAnnee }}</strong>.
        Si vous avez des revenus du capital, ne les indiquez pas ici, ils vous seront demandés ultérieurement.
      </p>
      <button
        type="button"
        class="btn btn-sm btn-selection btn-ressources"
        ng-repeat="ressourceType in ressourceTypes"
        ng-class="'capture-' + ressourceType.category"
        btn-checkbox
        ng-model="selectedRessourceTypes[ressourceType.id]">
        {{ ressourceType.label }}
      </button>
    </div>

    <div ng-switch-when="personnes">
      <p>Veuillez sélectionner les personnes qui touchent/ont touché les ressources que vous avez sélectionnées.</p>
      <div ng-repeat="ressourceType in ressourceTypes|filter: isRessourceSelected">
        <div class="row">
          <div class="col-sm-4">
            <button
              type="button"
              disabled
              class="btn btn-sm btn-selection btn-ressources"
              ng-class="'capture-' + ressourceType.category">
              {{ ressourceType.label }}
            </button>
            <b>Qui ?</b>
          </div>
          <div class="col-sm-8">
            <button
              type="button"
              class="btn btn-default btn-selection btn-selection-personne"
              ng-repeat="individuRef in individuRefs"
              btn-checkbox
              ng-model="individuRef.selectedRessourceTypes[ressourceType.id]">
              <i class="fa fa-male"></i>
              {{ individuRef.label }}
            </button>
          </div>
        </div>
        <hr ng-if="!$last">
      </div>
    </div>

    <div ng-switch-when="montants">
      <p>Veuillez entrer les montants des ressources sélectionnées (net perçu pour les salaires ou indemnités).</p>
      <div ng-repeat="individuRef in individuRefs" ng-if="individuRef.hasRessources">
        <h2 ng-if="1 < individuRefs.length">{{ individuRef.label }}</h2>
        <div class="table-responsive" ng-if="individuRef.hasRessourcesNonTns">
          <table class="table table-bordered">
            <thead>
              <tr>
                <th style="width: 200px;"></th>
                <th ng-repeat="month in months">{{ month.label|uppercaseFirst }}</th>
                <th>De {{ debutAnnee }} à {{ finAnnee }}</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="ressource in individuRef.ressources|filter: isRessourceNonTns" class="capture-{{ ressource.type.category }}">
                <td style="width: 200px; vertical-align: middle; color: black;">{{ ressource.type.label }}</td>
                <td ng-repeat="monthRessource in ressource.months">
                  <span class="input-group">
                    <input
                      type="number"
                      class="form-control text-right"
                      select-on-focus
                      zero-to-empty
                      ng-model="monthRessource.montant"
                      ng-change="updateMontantAnnuel(ressource)">
                    <span class="input-group-addon hidden-xs">€</span>
                  </span>
                  <span class="text-danger" ng-if="form.submitted && montantInvalide(monthRessource.montant)">
                    Montant invalide
                  </span>
                </td>
                <td>
                  <span class="input-group">
                    <input type="number" class="form-control text-right" ng-change="test(ressource.montantAnnuel)" select-on-focus zero-to-empty ng-model="ressource.montantAnnuel">
                    <span class="input-group-addon hidden-xs">€</span>
                  </span>
                  <span class="text-danger" ng-if="form.submitted && montantInvalide(ressource.montantAnnuel)">
                    Montant invalide
                  </span>
                </td>
              </tr>
            </tbody>
          </table>
        </div>

        <div class="table-responsive" ng-if="individuRef.hasRessourcesMicroTns">
          <table class="table table-bordered">
            <thead>
              <tr>
                <th style="width: 200px;"></th>
                <th>Type de structure</th>
                <th>Type d'activité</th>
                <th>Chiffre d’affaires {{ yearMoinsUn }}</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="ressource in individuRef.ressources|filter: isRessourceMicroTns" class="capture-tns">
                <td style="width: 200px; vertical-align: middle; color: black;">{{ ressource.type.label }}</td>
                <td style="width: 190px;">
                  <select class="form-control" ng-model="ressource.tnsStructureType">
                    <option value="auto_entrepreneur">Auto-entrepreneur</option>
                    <option value="micro_entreprise">Micro-entreprise</option>
                  </select>
                </td>
                <td style="width: 250px;">
                  <select class="form-control" ng-model="ressource.tnsActiviteType">
                    <option value="achat_revente">Achat/revente ou fourniture de logement</option>
                    <option value="bic">Activité commerciale ou artisanale (BIC)</option>
                    <option value="bnc">Activité libérale et/ou intellectuelle (BNC)</option>
                  </select>
                </td>
                <td>
                  <span class="input-group">
                    <input
                      type="number"
                      id="chiffre-affaires"
                      class="form-control text-right"
                      select-on-focus
                      zero-to-empty
                      ng-model="ressource.montantAnnuel">
                    <span class="input-group-addon hidden-xs">€</span>
                  </span>
                  <span class="text-danger" ng-if="form.submitted && montantInvalide(ressource.montantAnnuel)">
                    Montant invalide
                  </span>
                </td>
              </tr>
            </tbody>
          </table>
        </div>

        <div class="table-responsive" ng-if="individuRef.hasRessourcesOtherTns">
          <table class="table table-bordered">
            <thead>
              <tr>
                <th style="width: 200px;"></th>
                <th>Revenus sur le dernier exercice</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="ressource in individuRef.ressources|filter: isRessourceOtherTns" class="capture-tns">
                <td style="width: 200px; vertical-align: middle; color: black;">{{ ressource.type.label }}</td>
                <td>
                  <span class="input-group">
                    <input
                      type="number"
                      id="chiffre-affaires"
                      class="form-control text-right"
                      select-on-focus
                      zero-to-empty
                      ng-model="ressource.montantAnnuel">
                    <span class="input-group-addon hidden-xs">€</span>
                  </span>
                  <span class="text-danger" ng-if="form.submitted && montantInvalide(ressource.montantAnnuel)">
                    Montant invalide
                  </span>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <span class="text-danger" ng-if="form.submitted && form.$invalid">Veuillez entrer des montants valides</span>
    <button type="button" class="btn btn-default" ng-if="isCaptureRessourcesN2" ng-click="$dismiss()">Annuler</button>
    <button type="button" class="btn btn-default" ng-show="'ressources' !== tab" ng-click="previousTab()">
      &lt; Étape précédente<commit_msg>attribut required sur les input des montants des ressources + valeur minimale<commit_after><form method="post" name="form" novalidate ng-submit="submit(form)">
  <div class="modal-header">
    <h1 class="modal-title">Vos ressources</h1>
  </div>
  <div class="modal-body" ng-switch on="tab">
    <div ng-switch-when="ressources">
      <p>
        Cliquez sur les types de ressources que les personnes de votre foyer ont perçues
        <strong>entre {{ debutAnnee }} et {{ finAnnee }}</strong>.
        Si vous avez des revenus du capital, ne les indiquez pas ici, ils vous seront demandés ultérieurement.
      </p>
      <button
        type="button"
        class="btn btn-sm btn-selection btn-ressources"
        ng-repeat="ressourceType in ressourceTypes"
        ng-class="'capture-' + ressourceType.category"
        btn-checkbox
        ng-model="selectedRessourceTypes[ressourceType.id]">
        {{ ressourceType.label }}
      </button>
    </div>

    <div ng-switch-when="personnes">
      <p>Veuillez sélectionner les personnes qui touchent/ont touché les ressources que vous avez sélectionnées.</p>
      <div ng-repeat="ressourceType in ressourceTypes|filter: isRessourceSelected">
        <div class="row">
          <div class="col-sm-4">
            <button
              type="button"
              disabled
              class="btn btn-sm btn-selection btn-ressources"
              ng-class="'capture-' + ressourceType.category">
              {{ ressourceType.label }}
            </button>
            <b>Qui ?</b>
          </div>
          <div class="col-sm-8">
            <button
              type="button"
              class="btn btn-default btn-selection btn-selection-personne"
              ng-repeat="individuRef in individuRefs"
              btn-checkbox
              ng-model="individuRef.selectedRessourceTypes[ressourceType.id]">
              <i class="fa fa-male"></i>
              {{ individuRef.label }}
            </button>
          </div>
        </div>
        <hr ng-if="!$last">
      </div>
    </div>

    <div ng-switch-when="montants">
      <p>Veuillez entrer les montants des ressources sélectionnées (net perçu pour les salaires ou indemnités).</p>
      <div ng-repeat="individuRef in individuRefs" ng-if="individuRef.hasRessources">
        <h2 ng-if="1 < individuRefs.length">{{ individuRef.label }}</h2>
        <div class="table-responsive" ng-if="individuRef.hasRessourcesNonTns">
          <table class="table table-bordered">
            <thead>
              <tr>
                <th style="width: 200px;"></th>
                <th ng-repeat="month in months">{{ month.label|uppercaseFirst }}</th>
                <th>De {{ debutAnnee }} à {{ finAnnee }}</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="ressource in individuRef.ressources|filter: isRessourceNonTns" class="capture-{{ ressource.type.category }}">
                <td style="width: 200px; vertical-align: middle; color: black;">{{ ressource.type.label }}</td>
                <td ng-repeat="monthRessource in ressource.months">
                  <span class="input-group">
                    <input
                      type="number"
                      class="form-control text-right"
                      required
                      min="0"
                      select-on-focus
                      zero-to-empty
                      ng-model="monthRessource.montant"
                      ng-change="updateMontantAnnuel(ressource)">
                    <span class="input-group-addon hidden-xs">€</span>
                  </span>
                  <span class="text-danger" ng-if="form.submitted && montantInvalide(monthRessource.montant)">
                    Montant invalide
                  </span>
                </td>
                <td>
                  <span class="input-group">
                    <input
                      type="number"
                      class="form-control text-right"
                      required
                      min="0"
                      select-on-focus
                      zero-to-empty
                      ng-model="ressource.montantAnnuel">
                    <span class="input-group-addon hidden-xs">€</span>
                  </span>
                  <span class="text-danger" ng-if="form.submitted && montantInvalide(ressource.montantAnnuel)">
                    Montant invalide
                  </span>
                </td>
              </tr>
            </tbody>
          </table>
        </div>

        <div class="table-responsive" ng-if="individuRef.hasRessourcesMicroTns">
          <table class="table table-bordered">
            <thead>
              <tr>
                <th style="width: 200px;"></th>
                <th>Type de structure</th>
                <th>Type d'activité</th>
                <th>Chiffre d’affaires {{ yearMoinsUn }}</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="ressource in individuRef.ressources|filter: isRessourceMicroTns" class="capture-tns">
                <td style="width: 200px; vertical-align: middle; color: black;">{{ ressource.type.label }}</td>
                <td style="width: 190px;">
                  <select class="form-control" ng-model="ressource.tnsStructureType">
                    <option value="auto_entrepreneur">Auto-entrepreneur</option>
                    <option value="micro_entreprise">Micro-entreprise</option>
                  </select>
                </td>
                <td style="width: 250px;">
                  <select class="form-control" ng-model="ressource.tnsActiviteType">
                    <option value="achat_revente">Achat/revente ou fourniture de logement</option>
                    <option value="bic">Activité commerciale ou artisanale (BIC)</option>
                    <option value="bnc">Activité libérale et/ou intellectuelle (BNC)</option>
                  </select>
                </td>
                <td>
                  <span class="input-group">
                    <input
                      type="number"
                      id="chiffre-affaires"
                      class="form-control text-right"
                      required
                      min="0"
                      select-on-focus
                      zero-to-empty
                      ng-model="ressource.montantAnnuel">
                    <span class="input-group-addon hidden-xs">€</span>
                  </span>
                  <span class="text-danger" ng-if="form.submitted && montantInvalide(ressource.montantAnnuel)">
                    Montant invalide
                  </span>
                </td>
              </tr>
            </tbody>
          </table>
        </div>

        <div class="table-responsive" ng-if="individuRef.hasRessourcesOtherTns">
          <table class="table table-bordered">
            <thead>
              <tr>
                <th style="width: 200px;"></th>
                <th>Revenus sur le dernier exercice</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="ressource in individuRef.ressources|filter: isRessourceOtherTns" class="capture-tns">
                <td style="width: 200px; vertical-align: middle; color: black;">{{ ressource.type.label }}</td>
                <td>
                  <span class="input-group">
                    <input
                      type="number"
                      id="chiffre-affaires"
                      class="form-control text-right"
                      required
                      min="0"
                      select-on-focus
                      zero-to-empty
                      ng-model="ressource.montantAnnuel">
                    <span class="input-group-addon hidden-xs">€</span>
                  </span>
                  <span class="text-danger" ng-if="form.submitted && montantInvalide(ressource.montantAnnuel)">
                    Montant invalide
                  </span>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <span class="text-danger" ng-if="form.submitted && form.$invalid">Veuillez entrer des montants valides</span>
    <button type="button" class="btn btn-default" ng-if="isCaptureRessourcesN2" ng-click="$dismiss()">Annuler</button>
    <button type="button" class="btn btn-default" ng-show="'ressources' !== tab" ng-click="previousTab()">
      &lt; Étape précédente
{'fraction_non_alphanumeric': 0.1282448201952846, 'fraction_numerical': 0.004048582995951417, 'mean_word_length': 1.5601280292638318, 'pattern_counts': {'":': 0, '<': 333, '<?xml version=': 0, '>': 331, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1457634', 'n_tokens_mistral': 4884, 'n_tokens_neox': 4569, 'n_words': 908}