{% set view = extension.view() %} {% set config = view.analysis.config %}

Transfers between institutions are booked twice, once on each side, against {{ config.transit_account }}. The two legs are paired when they are opposite, in the same currency and no more than {{ view.days }} days apart; what is left over is either a leg whose counterpart has not been imported yet, or a transfer that skipped the transit account altogether.

{% for key, value in request.args.items() %} {% if key != "days" %}{% endif %} {% endfor %}
{% if view.filtered %}

A time filter is active, so the diagram and the tables below only show {{ view.begin or "the beginning" }} to {{ view.end or "the end" }}. Pairing itself always runs over the whole ledger, otherwise a transfer straddling the edge of the period would look unmatched.

{% endif %}
{{ view.postings|length }}
postings on the account
{{ view.pairs|length }}
completed transfers
{{ view.unmatched|length }}
unmatched legs
{{ view.direct|length }}
transfers skipping the account
{% for amount, currency in view.stuck %}
{{ amount|format_currency(currency) }} {{ currency }}
net of the unmatched legs
{% endfor %}
{# ---------------------------------------------------------------- Sankey #} {% for currency in view.currencies %} {% set diagram = view.diagram(currency) %} {% if not diagram.empty %}

Flows between institutions{% if view.currencies|length > 1 %} — {{ currency }}{% endif %}

completed transfer missing counterpart leg booked without the transit account

On the left, the institution the money left; on the right, the one it reached. An institution appears on both sides when it both sends and receives, and a ribbon from a name back to itself is a transfer between two of its own accounts.

{% for link in diagram.links %} {{ link.source }} → {{ link.target }}: {{ link.value|format_currency(currency) }} {{ currency }} ({{ link.count }} transfer{{ "" if link.count == 1 else "s" }}) {% endfor %} {% for node in diagram.nodes %} {{ node.label }}: {{ node.value|format_currency(currency) }} {{ currency }} {% if node.side == 'left' %}{{ node.value|format_currency(currency) }}{{ node.label }}{% else %}{{ node.label }}{{ node.value|format_currency(currency) }}{% endif %} {% endfor %}
{% endif %} {% endfor %} {# ------------------------------------------------------- unmatched table #}

Unmatched legs

{% if not view.unmatched %}

Every posting on {{ config.transit_account }} has its counterpart.

{% else %} {% for posting in view.unmatched %} {% endfor %}
DateAmountInstitution DescriptionSource
{{ posting.date }} {{ posting.amount|format_currency(posting.currency) }} {{ posting.currency }} {{ posting.institution or "—" }}
{{ "sent, never arrived" if posting.outgoing else "arrived, never sent" }}
{{ posting.description }} {{ view.relpath(posting.filename) }}:{{ posting.lineno }}
{% endif %} {# ---------------------------------------------------------- direct table #}

Transfers that skip {{ config.transit_account }}

{% if not view.direct %}

No transfer between institutions was booked directly.

{% else %} {% for transfer in view.direct %} {% endfor %}
DateAmountAccounts DescriptionSource
{{ transfer.date }} {% if transfer.amount is not none %} {{ transfer.amount|format_currency(transfer.currency) }} {{ transfer.currency }} {% else %}—{% endif %} {{ transfer.accounts|join(" ↔ ") }} {{ transfer.description }} {{ view.relpath(transfer.filename) }}:{{ transfer.lineno }}
{% endif %}