{% if KOH_ALLOW_COTISATION == 'true' %} {% set cotisations = getValidCotisations(app.user, app.request) %} {% if cotisations|length > 0 %} {% set idcard = 'cotisationspresta' %} {% extends '@kohinos/block/block_collapse.html.twig' %} {% block blocktitle %} {{ 'Mes cotisations à l\'association'|trans }} {% endblock blocktitle %} {% block blocksubtitle %} {% endblock blocksubtitle %} {% block blockcontent %} {% if KOH_ALLOW_COTISATION == 'true' and false == isCotisationValid(app.user) %} {% if cotisations|length > 0 %}
{{ 'Votre dernière cotisation est arrivée à expiration, veuillez cotiser de nouveau pour accéder aux fonctionnalités de votre compte !'|trans }}
{% else %}
{{ 'Si vous souhaitez utiliser les fonctionnalités de votre compte, vous devez avoir une cotisation valide !'|trans }}
{% endif %} {% endif %} {% set cotisEnd = false %} {% if (app.user and is_granted('ROLE_ADHERENT') and app.user.adherent) %} {% set cotisEnd = isCotisationValidForAdherent(app.user.adherent) %} {% elseif (app.user and is_granted('ROLE_PRESTATAIRE') and app.session.has('_prestagere')) %} {% set cotisEnd = isCotisationValidForPresta(app.session.get('_prestagere')) %} {% endif %} {% if false != cotisEnd %} {{ "Votre cotisation est à jour jusqu'au %date%" |trans({'%date%': cotisEnd|date('d/m/Y')}) }} {# Vérifier si la cotisation couvre toute l'année en cours #} {% set currentYear = "now"|date('Y') %} {% set endOfCurrentYear = currentYear ~ '-12-31' %} {% if cotisEnd|date('Y-m-d') >= endOfCurrentYear %} {# La cotisation couvre toute l'année en cours, proposer l'année suivante #} {{ "Cotiser pour l'année suivante"|trans }} {% else %} {# La cotisation expire pendant l'année en cours, proposer de cotiser pour l'année en cours #} {{ "Cotiser pour l'année en cours"|trans }} {% endif %} {% else %} {{ 'Cotiser'|trans }} {% endif %} {% endblock blockcontent %} {% endif %} {% endif %}