{% set selectionSubmitAction = selection_submit_action|default(path('portail_convention_flex_submit', { id: convention.idtoken })) %} {% set selectionRedirectTo = selection_redirect_to|default(path('portail_convention_view', { id: convention.idtoken })) %} {% set selectionDetailUrl = selection_detail_url|default(path('portail_convention_view', { id: convention.idtoken })) %} {% set selectionSubmitLabel = selection_submit_label|default('Soumettre ma sélection') %} {% set postSignatureEdit = canFlexEditAfterSignature|default(false) %}

{{ postSignatureEdit ? 'Modifier mes contreparties' : 'Choisir mes contreparties' }}

{{ postSignatureEdit ? 'Ajustez votre sélection dans la limite des disponibilités. Les contreparties déjà réalisées ne peuvent pas être retirées.' : 'Composez votre formule en sélectionnant des contreparties dans le catalogue.' }}
{% if formule.flex and (canAccessFlexSelection|default(convention.statut == 'En attente de sélection des contreparties')) %} {% set creditsAvailable = creditsSelectable|default(((creditsTotal - formule.valeurUtilisee) > 0 ? (creditsTotal - formule.valeurUtilisee) : 0)) %} {% set selectionInitial = selectedTotal|default(creditsAvailable - creditsRemaining) %} {% set categories = {'Tous': 'Tous'} %} {% for option in options %} {% set type = option.typeContrepartie %} {% set cat = type and type.categorie ? type.categorie.nom : 'Autres' %} {% set categories = categories|merge({ (cat): cat }) %} {% endfor %} {% for label, messages in app.flashes %} {% for message in messages %}
{{ message }}
{% endfor %} {% endfor %}
Crédit total
{{ creditsTotal|separate_thousands }}€
Consommé
{{ selectionInitial|separate_thousands }}
Restant
{{ creditsRemaining|separate_thousands }}
{% set progress = creditsAvailable > 0 ? (selectionInitial / creditsAvailable * 100) : 0 %}
Vous ne pouvez pas dépasser votre crédit.

Catalogue

{% for category in categories %} {% endfor %}
{% for option in options %} {% set type = option.typeContrepartie %} {% set existingQty = selectionMap[type.idtoken].quantite|default(0) %} {% set isUnlimited = type.nombreMax == 0 %} {% set available = isUnlimited ? null : (type.nombreMax - type.nombreActivation + existingQty) %} {% set isRequired = option.obligatoire %} {% set statusLocked = lockedByStatus[type.idtoken]|default(false) %} {% set realizedMin = realizedByType[type.idtoken]|default(0) %} {% set minQty = isRequired ? max(1, realizedMin) : realizedMin %} {% if statusLocked %} {% set minQty = max(minQty, existingQty) %} {% endif %} {% set currentQty = selectionMap[type.idtoken].quantite|default(minQty) %} {% set categoryName = type.categorie ? type.categorie.nom : 'Autres' %}
{% if type.image %} {{ type.nom }} {% else %} {% endif %}
{{ type.nom }}
{% if type.description is defined and type.description %}

{{ type.description }}

{% endif %}
{% if isRequired %}Inclus{% endif %} {% if realizedMin > 0 %}{{ realizedMin }} réalisée(s){% endif %} {% if statusLocked %}Statut réalisé{% endif %} Dispo : {% if isUnlimited %}∞{% else %}{{ available }}{% endif %} {{ categoryName }}
{{ type.valeur|separate_thousands }}€
/ unité
{% if isRequired %} Inclus dans la formule {% else %} {% endif %}
{% else %}
Aucune contrepartie sélectionnable.
{% endfor %}

Votre sélection

{% for option in options %} {% set type = option.typeContrepartie %} {% set existingQty = selectionMap[type.idtoken].quantite|default(0) %} {% set isUnlimited = type.nombreMax == 0 %} {% set available = isUnlimited ? null : (type.nombreMax - type.nombreActivation + existingQty) %} {% set isRequired = option.obligatoire %} {% set statusLocked = lockedByStatus[type.idtoken]|default(false) %} {% set realizedMin = realizedByType[type.idtoken]|default(0) %} {% set minQty = isRequired ? max(1, realizedMin) : realizedMin %} {% if statusLocked %} {% set minQty = max(minQty, existingQty) %} {% endif %} {% set currentQty = selectionMap[type.idtoken].quantite|default(minQty) %} {% set minInputQty = statusLocked ? currentQty : minQty %}
{{ type.nom }}
{{ type.valeur|separate_thousands }}€ / unité
{% if statusLocked %} Cette contrepartie est réalisée : minimum = {{ currentQty }}. {% endif %}
{% endfor %}
Sélection actuelle {{ selectionInitial|separate_thousands }}
Crédit restant {{ creditsRemaining|separate_thousands }}
{% else %}

Formule : {{ formule.nom }}

{% if not formule.flex %} Cette formule n'est pas flexible. {% else %} La modification de la sélection n'est pas autorisée pour cette convention. {% endif %}

Voir le détail
{% endif %}