{% extends "base.html" %} {% import "_bank.html" as bank with context %} {% import "_ledger.html" as ledger_row with context %} {% block title %}{{ t('statements.title') }} — painfree{% endblock %} {% block body %}
{% if family == 'account' %}{{ t('statements.lede') }}{% else %}{{ t('statements.lede_documents') }}{% endif %}
{# Three tabs. The account is what a reader has in mind; the documents are what arrived, and are still one click away for the day somebody needs a particular one. #} {% set filters = ('&connection_id=' ~ selected_connection if selected_connection else '') ~ ('&message_type=' ~ selected_type if selected_type else '') %}{{ t('statements.tab_account') }} {{ t('statements.tab_accounts') }} {{ counts.get('account') | count }} {{ t('statements.tab_responses') }} {{ counts.get('response') | count }}
{% if family == 'account' %} {# ---- the account overview ------------------------------------------------ #} {# Two selects and a button, no script: choosing a bank submits and lands on that bank's account, then the second select offers the bank's accounts. The bank select is there before any statement is, so the page always says which connections the reader holds. #} {% if not accounts %}{{ t('statements.no_accounts') }}
{{ t('statements.no_accounts_here') }}
{%- if not overview.days %}{{ t('statements.no_statements_in_period') }} {%- elif overview.continuous %}✓ {{ t('statements.coverage', count=overview.days | length, from_day=overview.oldest.to_datetime | day, to_day=overview.newest.to_datetime | day) }} {%- else %}× {% for older, newer in overview.gaps %} {{ t('statements.gap', before=older.to_datetime | day, after=newer.to_datetime | day) }} {% endfor %}{% endif %}
{% set chart = overview.chart() %} {% if chart %}| {{ t('account.booked') }} | {{ t('account.value_date') }} | {{ t('account.counterparty') }} | {{ t('account.money_out') }} | {{ t('account.money_in') }} | {{ t('account.balance') }} |
|---|---|---|---|---|---|
| {{ t('statements.since_last') }} {{ t('statements.since_last_note') }} | |||||
{{ day.date | day }}
{{ day.row.message_type }}
{%- if day.row.identification %} · {{ day.row.identification }}{% endif %}
· +{{ day.ledger.credited | amount }} · −{{ day.ledger.debited | amount }} | |||||
| {{ t('account.no_entries') }} | |||||
| {{ t('statements.no_statements_in_period') }} | |||||
{{ t('account.balance_derived') }}
{{ t('statements.empty') }}
{% else %}| {{ t('statements.reports_on') }} | {{ t('order.status') }} | {{ t('order.accepted_count') }} | {{ t('order.rejected_count') }} | {{ t('order.reason') }} | {{ t('response.received') }} |
|---|---|---|---|---|---|
{% if row.order_id %}{{ row.order_id }}
{% else %}{{ t('response.unmatched_heading') }}{% endif %}
{{ row.statement_id }} |
{% if row.outcome.status %}
{{ row.outcome.status }}
{{ code.name if code else t('response.unknown_status') }} {% else %}{{ t('response.not_reported') }}{% endif %} |
{{ row.outcome.accepted | count }} | {{ row.outcome.rejected | count }} | {% if row.outcome.reason_code %}{{ row.outcome.reason_code }} {% endif %}
{{ bank.quiet(row.outcome.reason_text) }} |
{{ row.ingested_at | moment }} |
{{ t('statements.empty') }}
{% else %}| {{ t('statements.account') }} | {{ t('statement.period') }} | {{ t('statements.closing_balance') }} | {{ t('statements.entries') }} | {{ t('statements.type') }} | {{ t('order.ingested') }} |
|---|---|---|---|---|---|
{{ row.iban or '—' }}
{% if row.currency %}{{ row.currency }}{% endif %}
{{ row.connection_id }}
{{ row.statement_id }} |
{% if row.from_datetime %}{{ row.from_datetime | day }} → {{ row.to_datetime | day }}
{% else %}{{ row.ingested_at | day }}{% endif %}
{% if row.sequence_number %} {{ t('statement.sequence') }} {{ row.sequence_number }}{% endif %} |
{% if row.closing_balance is not none %}{{ row.closing_balance | amount(row.currency) }}{% else %}—{% endif %} | {{ row.entry_count | count }} | {{ row.message_type }} | {{ row.ingested_at | moment }} |