{% macro table_elements(elements, family) %} {% set total = 0 %} {% for f in elements %} {% set total = total + f.amount %} {% endfor %}
{{ 'Budget element type'|trans }} {{ 'Amount'|trans }} {{ 'Validity period'|trans }}  
{% if f.isResource %} {{ f.resource.name|localize_translatable_string }} {% else %} {{ f.charge.name|localize_translatable_string }} {% endif %} {{ f.amount|format_currency('EUR') }} {% if f.endDate is not null %} {{ f.startDate|format_date('short') ~ ' - ' ~ f.endDate|format_date('short') }} {% else %} {{ 'depuis le ' ~ f.startDate|format_date('short') }} {% endif %}
    {% if is_granted('CHILL_BUDGET_ELEMENT_SEE', f) %}
  • {% endif %} {% if is_granted('CHILL_BUDGET_ELEMENT_UPDATE', f) %}
  • {% endif %} {% if is_granted('CHILL_BUDGET_ELEMENT_DELETE', f) %}
  • {% endif %}
{{ 'Total'|trans }} {{ total|format_currency('EUR') }}    
{% endmacro %} {% macro table_results(actualCharges, actualResources) %} {% set totalCharges = 0 %} {% for c in actualCharges %} {% set totalCharges = totalCharges + c.amount %} {% endfor %} {% set totalResources = 0 %} {% for r in actualResources %} {% set totalResources = totalResources + r.amount %} {% endfor %} {% set result = (totalResources - totalCharges) %}
  {{ 'Budget calculator result'|trans }}
{{ 'The balance'|trans }} {{ result|format_currency('EUR') }}
{% endmacro %}