{% extends "base.html" %} {% import "_bank.html" as bank with context %} {% block title %}{{ t('orders.title') }} — painfree{% endblock %} {% block body %}

{{ t('orders.heading') }}

{# `submitted`, `rejected` and `failed` are the contract's own state values and are shown untranslated beside the sentence that explains them: an operator reading a webhook and an operator reading this page have to be looking at one word. #}

{{ t('orders.lede') }}

{% if orders %} {# Recipient, amount and account first: they are what an operator is looking for when they open this page. The order id is how the service names the row and matters only once you already have the right row, so it moves to the end and stops being the thing the eye lands on. #} {% for row in orders %} {% set paid = payments.get(row.order_id) %} {# The control sum, which for a batch is the whole message and not the one transfer named beside it. Said in the label rather than left to be assumed. #} {% endfor %}
{{ t('orders.creditor') }}{{ t('orders.amount') }} {{ t('orders.creditor_iban') }} {{ t('common.state') }}{{ t('orders.scheme') }} {{ t('orders.return_code') }} {{ t('orders.report_text') }}{{ t('orders.accepted') }} {{ t('orders.order') }}
{{ (paid.creditor.name if paid else none) or '—' }} {% if paid and paid.batch %}
{{ t('orders.and_more', count=paid.extra) }}{% endif %}
{{ row.control_sum | amount(row.currency) }} {% if paid and paid.creditor.iban %}{{ paid.creditor.iban }} {% else %}—{% endif %} {{ row.state.value }}
{{ t('state.' ~ row.state.value) }}
{{ row.scheme.value }} {% if row.downgraded %}
{{ t('order.downgraded') }}{% endif %}
{% if row.return_code %}{{ row.return_code }}{% else %}—{% endif %} {% if row.report_text %}{{ bank.quiet(row.report_text) }}{% else %}—{% endif %} {{ row.accepted_at | moment }} {{ row.order_id }}
{{ row.connection_id }}

{{ t('bank.note') }}

{% else %}

{{ t('orders.empty') }}

{% endif %}
{% endblock %}