{% import 'macros/_account_macros.html' as account_macros with context %} {% import '_query_table.html' as querytable %} {% macro copy_balance_directives_text() -%} {% for account in ledger.attributes.accounts -%} {% if ledger.accounts[account].meta.get('fava-uptodate-indication') %} {%- if ledger.account_uptodate_status(account) != "green" -%} {{- account_macros.balance_directive(account) }} {%- endif -%} {% endif %} {%- endfor -%} {%- endmacro %}
{% set postings_per_account = 'SELECT account, count(account) ORDER BY account' %}

{{ _('Postings per Account') }} (Query)

{% set contents, result_types, result_rows = ledger.query_shell.execute_query(postings_per_account) %} {{ querytable.querytable(contents, result_types, result_rows) }}
{% set status_sortorder = { 'red': 5, 'yellow': 4, 'green': 3, '': 2 } %}

{{ _('Update Activity') }}

{% for account in ledger.attributes.accounts %} {% if account.startswith(ledger.options['name_assets']) or account.startswith(ledger.options['name_liabilities']) %} {% set last_entry = ledger.last_entry(account) %} {% if last_entry %} {% if ledger.accounts[account].meta.get('fava-uptodate-indication') %} {% else %} {% endif %} {% endif %} {% endif %} {% endfor %}
{{ _('Account') }} {{ _('Last Entry') }} {{ _('Balance') }}
{{ account_macros.indicator(account) }} {{ account_macros.last_account_activity(account) }} {{ last_entry.date }} {%- for position in (ledger.root_account|get_or_create(account)).balance|units -%} {{ position.units|format_amount }}
{% endfor -%}

{{ _('Entries per Type') }}

{% for group in ledger.entries|groupby('__class__.__name__') %} {% endfor %}
{{ _('Type') }} {{ _('# Entries') }}
{{ group.grouper }} {{ group.list|length }}
{{ _('Total') }} {{ ledger.entries|length }}