{% extends "base.html" %} {% block title %}{{ s.number }}{% endblock %} {% block content %} {% set cur = branch.currency %} {% set open = s.state == 'open' %}
{{ t('Bank Reconciliation') }} · {{ s.jcode }} — {{ nm({'name_en': s.jname_en, 'name_ar': s.jname_ar}) }}

{{ s.number }} {% if s.state == 'reconciled' %}{{ t('Reconciled') }}{% else %}{{ t('Open') }}{% endif %}

{{ s.name or '' }} · {{ s.date }}
{% if can_write %}
{% if open %}
{% else %}
{% endif %}
{% endif %}
{{ t('Starting balance') }}
{{ s.balance_start|money(cur) }}
{{ t('Ending balance') }}
{{ s.balance_end|money(cur) }}
{{ t('Computed') }} {{ tot.computed_end|money(cur) }}
{{ t('Difference') }}
{{ tot.difference|money(cur) }}
{{ t('To reconcile') }}
{{ tot.open }} / {{ tot.lines }}
{% for it in lines %}{% set ln = it.ln %} {% if ln.state == 'matched' %} {% elif open and can_write %} {% endif %} {% else %}{% endfor %}
{{ t('Date') }}{{ t('Description') }}{{ t('Reference') }}{{ t('Money in') }}{{ t('Money out') }}{{ t('Status') }}
{{ ln.date }}{{ ln.description or '' }}{% if ln.partner_name %}
{{ ln.partner_name }}{% endif %}
{{ ln.reference or '' }} {{ ln.amount|money(cur) if ln.amount > 0 else '' }}{{ (-ln.amount)|money(cur) if ln.amount < 0 else '' }} {% if ln.state == 'matched' %}✓ {{ t('Matched') }}{% else %}{{ t('To reconcile') }}{% endif %}
{% for m in it.matched %}{{ m.move_name }} {{ m.date }} · {{ m.label or '' }} · {{ (m.debit - m.credit)|money(cur) }}{% if not loop.last %} · {% endif %}{% endfor %} {% if can_write and open %}
{% endif %}
{% if it.cands %}{{ it.cands|length }} {{ t('suggested matches') }}{% else %}{{ t('No exact match — book it or pick items') }}{% endif %}
{% for c in it.cands + it.nearby %} {% else %}{% endfor %}
{{ c.date }}{{ c.move_name }} {{ nm({'name_en': c.pname_en, 'name_ar': c.pname_ar}) if c.pname_en else '' }} {{ c.label or c.ref or '' }} {{ (c.debit - c.credit)|money(cur) }}
{{ t('No unreconciled items on this account around this date.') }}
{% if it.cands or it.nearby %}{% endif %}
{{ t('Book it') }} {{ t('bank charges, interest, transfers…') }}
{% if it.invoices %}
{{ t('Payment for an invoice') }}
{% endif %}
{{ t('No lines yet. Import a CSV or add lines below.') }}
{% if open and can_write %}

{{ t('Add line') }}

{{ t('Import CSV') }}


{{ t('Statement details') }}

{% endif %} {% endblock %}