{% extends 'page-xhr-modal.html.twig' %} {% block title %}Resultat simulation{% endblock %} {% block style %} {% endblock %} {% block page %}
{% if resultats is defined and resultats | length > 0 %}
{% set coutTotal = 0 %} {% set total = [] %} {% set variables = [] %} {% set tranches = [] %} {% for critereValeur in criteresValeurs %} {% for key, criteres in critereValeur %} {% if key == 'variables' %} {% set variables = criteres %} {% endif %} {% endfor %} {% endfor %} {% for variable in variables %} {% if variable['libelle']|lower matches '/^tranche/' %} {% set tranches = tranches|merge([variable]) %} {% endif %} {% endfor %} {% for key, composant in composantsPlusBas %} {% if composant.idTypeComposant.libelle == 'Niveau'%}
{{ composant.nom }}
{% for tranche in tranches %} {% endfor %} {% for composantResultat in composantHierarchie[key] %} {% if composantResultat.idTypeComposant.libelle in ['Tarificateur', 'Produit'] %} {% set identifiantBeneficiaire = listeBeneficiaires | keys | first %} {% if resultats[key].getResultatsFormuleDataPourBeneficiaire()[identifiantBeneficiaire] is defined %} {% for tranche in tranches %} {% for key,value in resultats[key].getResultatsFormuleDataPourBeneficiaire()[identifiantBeneficiaire] %} {% if tranche['code'] == key %} {% if total[key] is defined %} {% set total = total|merge({ (key): total[key]+value['taux']}) %} {% else %} {% set total = total|merge({(key):value['taux']}) %} {% endif %} {% endif %} {% endfor %} {% endfor %} {% for tranche in tranches %} {% for key,value in resultats[key].getResultatsFormuleDataPourBeneficiaire()[identifiantBeneficiaire] %} {% if tranche['code'] == key %} {% endif %} {% endfor %} {% endfor %} {% for tranche in tranches %} {% for key,value in resultats[key].getResultatsFormuleDataPourBeneficiaire()[identifiantBeneficiaire] %} {% if tranche['code'] == key %} {% endif %} {% endfor %} {% endfor %} {% endif %} {% endif %} {% endfor %}
Nature{{ tranche['libelle'] }}
Taux de cotisation{{ value['taux'] }}
Montant de cotisation mensuel{{ value['tarif']|number_format(2) }} €
Montant de cotisation annuel{{ (value['tarif']*12)|number_format(2) }} €
{% endif %} {% endfor %}
Global
{% for tranche in tranches %} {% endfor %} {% set tauxTot = 0 %} {% set tarifMTot = 0 %} {% set tarifATot = 0 %} {% for tranche in tranches %} {% for key, res in total %} {% if tranche['code'] == key %} {% set tauxTot = tauxTot+res %} {% endif %} {% endfor %} {% endfor %} {% for tranche in tranches %} {% for key, res in total %} {% if tranche['code'] == key %} {% if tranche['valeur'] %} {% set tarifMTot = tarifMTot+res*tranche['valeur']/12 %} {% else %} {% endif %} {% endif %} {% endfor %} {% endfor %} {% for tranche in tranches %} {% for key, res in total %} {% if tranche['code'] == key %} {% if tranche['valeur'] %} {% set tarifATot = tarifATot+res*tranche['valeur'] %} {% else %} {% endif %} {% endif %} {% endfor %} {% endfor %}
Nature{{ tranche['libelle'] }}Totaux
Taux de cotisation{{ res }}{{ tauxTot }}
Montant de cotisation mensuel{{ (res*tranche['valeur']/12)|number_format(2) }} €0{{ tarifMTot|number_format(2) }} €
Montant de cotisation annuel{{ (res*tranche['valeur'])|number_format(2) }} €0{{ tarifATot|number_format(2) }} €
{% endif %}
{% endblock %}