{% extends "_layout.html" %} {% set active_page = 'statistics' %} {% import 'macros/_account_macros.html' as account_macros with context %} {% block content %} {% set statistics = api.statistics() %}

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

{% for account_name, num in statistics.postings_by_account|dictsort(false, 'value')|reverse %} {% endfor %}
{{ _('Type') }} {{ _('# Entries') }}
{{ num }}
{{ _('Total') }} {{ statistics.postings_by_account_total }}
{% macro copy_balance_directives_text(activity_by_account) -%} {{ _('Click to copy balance directives for accounts (except green ones) to the clipboard:') }} {% for activity in activity_by_account -%} {% if activity.account|uptodate_eligible %} {%- if api.is_account_uptodate(activity.account) != "green" -%} {{- account_macros.balance_directive(activity.account) }} {%- endif -%} {% endif %} {%- endfor -%} {%- endmacro %} {% set clipboard_text = copy_balance_directives_text(statistics.activity_by_account) %} {% set status_sortorder = { 'red': 5, 'yellow': 4, 'green': 3, '': 2 } %}

{{ _('Update Activity per Account') }}

{% for activity in statistics.activity_by_account %} {% if activity.account|uptodate_eligible %} {% with status=api.is_account_uptodate(activity.account) or '' %} {% endwith %} {% else %} {% endif %} {% endfor %}
{{ _('Account') }} {{ _('Last Entry') }} {{ _('Balance') }}
{{ account_macros.indicator(activity.account) }} {{ account_macros.last_account_activity(activity.account) }} {{ activity.last_posting_date }} {%- for position in api.inventory(activity.account) -%} {{ position.units|format_amount }}
{% endfor -%}

{{ _('Directive Type') }}

{% for type, num in statistics.entries_by_type|dictsort(false, 'value')|reverse %} {% endfor %}
{{ _('Type') }} {{ _('# Entries') }}
{{ type }} {{ num }}
{{ _('Total') }} {{ statistics.entries_by_type_total }}
{% endblock %}