{% extends "_layout.html" %}
{% set active_page = 'statistics' %}
{% import 'macros/_account_macros.html' as account_macros with context %}
{% macro copy_balance_directives_text() -%}
{% for account in ledger.attributes.accounts -%}
{% if account|uptodate_eligible %}
{%- if ledger.account_uptodate_status(account) != "green" -%}
{{- account_macros.balance_directive(account) }}
{%- endif -%}
{% endif %}
{%- endfor -%}
{%- endmacro %}
{% block content %}
{% set postings = ledger.postings %}
{{ _('Postings per Account') }}
{{ _('Account') }}
{{ _('# Postings') }}
{% for group in postings|groupby('account') %}
{{ group.grouper }}
{{ group.list|length }}
{% endfor %}
{{ _('Total') }}
{{ postings|length }}
{% set status_sortorder = { 'red': 5, 'yellow': 4, 'green': 3, '': 2 } %}
{{ _('Update Activity') }}{{ _('Copy balance directives') }}
{{ _('Account') }}
{{ _('Last Entry') }}
{{ _('Balance') }}
{% 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 %}
{{ account }}
{% if account|uptodate_eligible %}
{{ account_macros.indicator(account) }}
{{ account_macros.last_account_activity(account) }}
{% else %}
{% endif %}
{{ last_entry.date }}
{%- for position in (ledger.root_account|get_or_create(account)).balance -%}
{{ position.units|format_amount }}
{% endfor -%}
{% endif %}
{% endif %}
{% endfor %}
{{ _('Entries per Type') }}
{{ _('Type') }}
{{ _('# Entries') }}
{% for group in ledger.entries|groupby('__class__.__name__') %}
{{ group.grouper }}
{{ group.list|length }}
{% endfor %}
{{ _('Total') }}
{{ ledger.entries|length }}
{% endblock %}