{% include 'header.html' %}

{{ _('Processed results') }}

{% for account in accounts_data.accounts %} {% set dt_response = account.dt_response %}
{% set months = [] %} {% for agg_row in dt_response.data %} {% if (agg_row.month.display, agg_row.month.timestamp) not in months %} {% set _ = months.append((agg_row.month.display, agg_row.month.timestamp)) %} {% endif %} {% endfor %} {% for month_display, month_ts in months | sort(attribute='1', reverse=True) %} {% endfor %} {% set cat_month_map = {} %} {% for agg_row in dt_response.data %} {% if agg_row.category not in cat_month_map %} {% set _ = cat_month_map.update({agg_row.category: {}}) %} {% endif %} {% set _ = cat_month_map[agg_row.category].update({agg_row.month.display: agg_row}) %} {% endfor %} {% for category in cat_month_map.keys() | sort %} {% for month_display, month_ts in months | sort(attribute='1', reverse=True) %} {% set agg_row_data = cat_month_map[category].get(month_display) %} {% if agg_row_data %} {% set details_list = [] %} {% for detail in agg_row_data.details %} {% set _ = details_list.append(detail.date.display ~ ': ' ~ detail.amount.display ~ ' - ' ~ detail.merchant) %} {% endfor %} {% set details_str = details_list | join('
') %} {% else %} {% endif %} {% endfor %} {% endfor %}
{{ _('Categories') }}{{ month_display }}
{{ category }}{{ agg_row_data.total.display }}
{% endfor %}