{# templates/faturamento/pdf.html.twig #} {% set meses = { 1:'Janeiro', 2:'Fevereiro', 3:'Março', 4:'Abril', 5:'Maio', 6:'Junho', 7:'Julho', 8:'Agosto', 9:'Setembro', 10:'Outubro', 11:'Novembro', 12:'Dezembro' } %} Faturamento {{ ano }}

Relatório de Faturamento - {{ holdingAtual }}

Ano: {{ ano }}
{% set soma = 0 %} {% for m in 1..12 %} {% set r = porMes[m] is defined ? porMes[m] : null %} {% set total = r ? (r.totalLiquido|default(0)) : 0 %} {% set soma = soma + total %} {% endfor %}
Mês Total
{{ meses[m] }} {{ "%02d"|format(m) }}/{{ ano }} {% if total > 0 %} R$ {{ total|number_format(2, ',', '.') }} {% else %} Sem lançamentos {% endif %}
Total R$ {{ soma|number_format(2, ',', '.') }}