{% extends "base.html" %} {% block title %}{{ t('Bank') }}{% endblock %} {% block content %}

{{ t('Bankimport') }}

{{ t('Kontoauszug importieren (camt.053/054 XML):') }} {{ t('Enthält die Datei eine IBAN, die bei einem Konto hinterlegt ist, gewinnt diese.') }}
{% if reconciliations %}

{{ t('Abgleich Kontoauszug ↔ Kontoblatt') }}

{% for r in reconciliations %} {% endfor %}
{{ t('Konto') }}{{ t('Auszug per') }}{{ t('Saldo Auszug') }} {{ t('Saldo Kontoblatt') }}{{ t('Differenz') }}
{{ r.stmt.acc_number }} {{ r.stmt.acc_name }} {{ r.stmt.closing_date|datum }} {{ r.stmt.closing_balance_rp|chf }} {{ r.ledger|chf }} {{ '✓ ' + t('stimmt') if r.diff == 0 else r.diff|chf }}
{% endif %}

{{ t('Offene Transaktionen') }} ({{ open_tx|length }})

{% if open_tx %} {% for tx in open_tx %} {% endfor %}
{{ t('Datum') }}{{ t('Text / Gegenpartei') }}CHF{{ t('Verbuchen als') }}
{{ tx.booking_date|datum }} {{ tx.text or tx.counterparty }} {% if tx.counterparty and tx.text %}
{{ tx.counterparty }}{% endif %} {% if tx.ref %}
Ref: {{ tx.ref }}{% endif %}
{{ '+' if tx.direction == 'CRDT' else '−' }}{{ tx.amount_rp|chf }} {% if suggestions.get(tx.id) %} {% set sug = suggestions[tx.id] %}
{{ t('Vorschlag') }} {{ t('Zahlung') }} {{ t('Rechnung') }} {{ sug.inv.number }} ({{ sug.inv.customer }}) {% if sug.amount_differs %} {{ t('Betrag ≠ offen {rest} → Teilzahlung', rest=sug.rest|chf) }} {% endif %}
{{ t('stattdessen manuell…') }} {% endif %}
{% if suggestions.get(tx.id) %}
{% endif %}
{% else %}

{{ t('Keine offenen Transaktionen – Kontoauszug importieren, um zu starten.') }}

{% endif %} {% if done_tx %}

{{ t('Erledigt (letzte 50)') }}

{% for tx in done_tx %} {% endfor %}
{{ t('Datum') }}{{ t('Text') }}CHF{{ t('Status') }}{{ t('Buchung') }}
{{ tx.booking_date|datum }} {{ tx.text or tx.counterparty }} {{ '+' if tx.direction == 'CRDT' else '−' }}{{ tx.amount_rp|chf }} {{ t(tx.status) }} {{ tx.entry_text or '' }} {% if tx.status == 'ignoriert' %}
{% endif %}
{% endif %} {% endblock %}