{% 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 }}  
{{ f.type|budget_element_type_display(family) }} {{ f.amount|format_currency('EUR') }} {% if f.endDate is not null %} {{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': f.startDate|format_date('short'), '%endDate%': f.endDate|format_date('short') } ) }} {% else %} {{ 'Valid since %startDate%'|trans( { '%startDate%': 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 }}
Result   {{ result|format_currency('EUR') }}
{% endmacro %}