{% extends admin.getTemplate('base_list_field') %} {% block field %} {% set isSsa = object.requestType is defined and object.requestType == 'ssa' %} {% set hasNewAmount = object.newAmountRequested is not null %} {% set hasNewDebitDate = isSsa and object.newDebitDateRequested is not null %} {% set hasModification = (hasNewAmount or hasNewDebitDate) and object.modificationRequestedAt is not null %} {% if hasModification %} {% set oldAmount = object.amount %} {% set newAmount = hasNewAmount ? object.newAmountRequested : null %} {% set oldDebitDate = isSsa ? object.autoDebitDate : null %} {% set newDebitDate = hasNewDebitDate ? object.newDebitDateRequested : null %} {% set tooltipText = 'Modification demandée le ' ~ object.modificationRequestedAt|date('d/m/Y H:i') %}
{% if newAmount is not null and oldAmount %} {% set variance = newAmount - oldAmount %} {% set percentChange = (variance / oldAmount * 100)|round(1) %} {{ oldAmount|number_format(2, ',', ' ') }}€ → {{ newAmount|number_format(2, ',', ' ') }}€ {% if variance > 0 %} (+{{ percentChange }}%) {% else %} ({{ percentChange }}%) {% endif %} {% endif %} {% if newDebitDate is not null and oldDebitDate is not null %} {% if newAmount is not null %}
{% endif %} Date: {{ oldDebitDate|date('d/m/Y') }} → {{ newDebitDate|date('d/m/Y') }} {% endif %}
{# Boutons d'action #} {% if admin.hasAccess('edit', object) %}
{% if admin.hasRoute('approveModification') %} {% endif %} {% if admin.hasRoute('rejectModification') %} {% endif %}
{% endif %}
{% else %} - {% endif %} {% endblock %}