{# Bloc réutilisable pour afficher les modifications en attente de validation Paramètres requis : - subscriptions : Collection de RecurringSubscriptionRequest (MLC/SSA) - purchases : Collection de RecurringPurchaseRequest #} {% set hasPendingModifications = false %} {% set pendingItems = [] %} {# Vérifier les cotisations MLC/SSA #} {% if subscriptions is defined %} {% for subscription in subscriptions %} {% set isSsa = subscription.requestType == 'ssa' %} {% if subscription.hasModificationRequest() %} {% set hasPendingModifications = true %} {% set pendingItems = pendingItems|merge([{ 'type': 'subscription', 'label': isSsa ? 'Cotisation SSA' : 'Cotisation MLC', 'currentAmount': subscription.amount, 'newAmount': subscription.newAmountRequested, 'currentDate': isSsa ? subscription.autoDebitDate : null, 'newDate': isSsa ? subscription.newDebitDateRequested : null, 'requestedAt': subscription.modificationRequestedAt, 'url': path('adherent_modify_subscription', {id: subscription.id}) }]) %} {% endif %} {% endfor %} {% endif %} {# Vérifier les achats récurrents #} {% if purchases is defined %} {% for purchase in purchases %} {% if purchase.hasModificationRequest() %} {% set hasPendingModifications = true %} {% set pendingItems = pendingItems|merge([{ 'type': 'purchase', 'label': 'Achat mensuel récurrent', 'currentAmount': purchase.monthlyAmount, 'newAmount': purchase.newAmountRequested, 'currentDay': purchase.debitDay, 'newDay': purchase.newDebitDay, 'requestedAt': purchase.modificationRequestedAt, 'url': path('adherent_recurring_purchase') }]) %} {% endif %} {% endfor %} {% endif %} {% if hasPendingModifications %}
{% if pendingItems|length == 1 %} Une modification en attente de validation {% else %} {{ pendingItems|length }} modifications en attente de validation {% endif %}

Modifications en attente de validation par le trésorier :

{% for item in pendingItems %}
{{ item.label }}
    {% if item.newAmount is not null %}
  • Montant : {{ item.currentAmount|number_format(2, ',', ' ') }}€ → {{ item.newAmount|number_format(2, ',', ' ') }}€ {% set variance = item.newAmount - item.currentAmount %} {% if variance > 0 %} (+{{ (variance / item.currentAmount * 100)|round(1) }}%) {% else %} ({{ (variance / item.currentAmount * 100)|round(1) }}%) {% endif %}
  • {% endif %} {% if item.newDate is defined and item.newDate is not null %}
  • Date de prélèvement : {{ item.currentDate|date('d/m/Y') }} → {{ item.newDate|date('d/m/Y') }}
  • {% endif %} {% if item.newDay is defined and item.newDay is not null %}
  • Jour de prélèvement : Le {{ item.currentDay }} → Le {{ item.newDay }}
  • {% endif %}

Demandée le {{ item.requestedAt|date('d/m/Y à H:i') }}

{% endfor %}

Le trésorier examinera votre demande prochainement. Vous serez notifié de sa décision.

{% endif %}