{# One entry of an account statement, and its drawer. A `
` is the whole disclosure mechanism: a real button for a keyboard and a screen reader without anybody writing `role`, `tabindex` and an Escape handler, and it works with scripting off, which is the rule for everything in this console except the theme toggle. In a file of its own because a macro defined in a template that `extends` another is not reliably in scope inside its blocks. #} {% macro row(line, running) %} {{ line.entry.get('booking_date') | day }} {{ line.entry.get('value_date') | day }}
{%- set party = line.counterparty %} {{ (party.get('name') if party else none) or line.description or line.entry.get('reference') or '—' }} {% if line.order_id %}{{ t('account.our_payment') }}{% endif %} {% if line.entry.get('reversal') %}{{ t('account.reversal') }}{% endif %} {# What the entry is about, on the closed row. A statement whose rows name only a counterparty is a statement an operator has to open every line of. #} {% if party and line.description %}
{{ line.description }}{% endif %}
{% set code = line.entry.get('bank_transaction_code') or {} %} {% if code.get('domain') or code.get('proprietary') %} {% endif %} {% if line.entry.get('additional_information') %} {% endif %} {% if line.order_id %} {% endif %}
{{ t('account.entry_reference') }} {{ line.entry.get('reference') or '—' }} {% if line.entry.get('account_servicer_reference') %} {{ line.entry.get('account_servicer_reference') }}{% endif %}
{{ t('account.transaction_code') }} {{ code.get('proprietary') or (code.get('domain') ~ ' / ' ~ (code.get('family') or '') ~ ' / ' ~ (code.get('sub_family') or '')) }}
{{ t('account.additional') }}{{ line.entry.get('additional_information') }}
{{ t('account.our_payment') }} {{ line.order_id }}
{# One entry may collect many transactions. A payroll run is one line in the ledger and two hundred here, which is what the drawer is for. #} {% if line.entry.get('transactions') %} {% for transaction in line.entry.get('transactions') %} {% endfor %}
{{ t('account.counterparty') }}{{ t('order.amount') }} {{ t('account.end_to_end') }}{{ t('account.remittance') }}
{% set other = transaction.get('counterparty') or {} %} {{ other.get('name') or '—' }} {% if other.get('iban') %}
{{ other.get('iban') }}{% endif %} {% if other.get('bic') %}
{{ other.get('bic') }}{% endif %}
{{ transaction.get('amount') | amount(transaction.get('currency')) }} {% if transaction.get('instructed_amount') %}
{{ transaction.get('instructed_amount').get('amount') | amount(transaction.get('instructed_amount').get('currency')) }}{% endif %}
{% if transaction.get('end_to_end_id') %}{{ transaction.get('end_to_end_id') }}{% endif %} {% if transaction.get('instruction_id') %}
{{ transaction.get('instruction_id') }}{% endif %} {% if transaction.get('message_identification') %}
{{ t('account.our_message') }} {{ transaction.get('message_identification') }}{% endif %}
{{ transaction.get('remittance_information') or transaction.get('additional_information') or '—' }} {% set reference = transaction.get('reference') or {} %} {% if reference.get('reference') %}
{{ reference.get('type') }} {{ reference.get('reference') }}{% endif %}
{% endif %}
{% if not line.credit %}{{ line.amount | amount(line.entry.get('currency')) }}{% endif %} {% if line.credit %}{{ line.amount | amount(line.entry.get('currency')) }}{% endif %} {% if running and line.balance is not none %}{{ line.balance | amount(line.entry.get('currency')) }}{% endif %} {% endmacro %}