{% extends "_layout.html" %} {% import 'macros/_account_macros.html' as account_macros %} {% import 'macros/_commodity_macros.html' as commodity_macros %} {% import '_query_table.html' as querytable %} {% set page_title = _('Statistics') %} {% block content %}
{% 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(g.filtered.entries, postings_per_account) %} {{ querytable.querytable(ledger, contents, result_types, result_rows) }}
{% set status_sortorder = { 'red': 5, 'yellow': 4, 'green': 3, '': 2 } %}

{{ _('Update Activity') }}{{ _('Copy balance directives') }}

{% for account in ledger.attributes.accounts %} {% if account.startswith(ledger.options['name_assets']) or account.startswith(ledger.options['name_liabilities']) %} {% set last_entry = ledger.accounts[account].last_entry %} {% if last_entry %} {% if ledger.accounts[account].uptodate_status %} {% else %} {% endif %} {% endif %} {% endif %} {% endfor %}
{{ _('Account') }} {{ _('Last Entry') }} {{ _('Balance') }}
{{ account_macros.indicator(ledger, account) }} {{ account_macros.last_account_activity(ledger, account) }} {{ last_entry.date }} {%- for amt in ((g.filtered.root_tree.get(account)).balance|units).amounts() -%} {{ commodity_macros.render_amount(ledger, amt) }}
{% endfor -%}

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

{% for type, entries in ledger.group_entries_by_type(g.filtered.entries)._asdict().items() %} {% endfor %}
{{ _('Type') }} {{ _('# Entries') }}
{{ type }} {{ entries|length }}
{{ _('Total') }} {{ g.filtered.entries|length }}
{% endblock %}