{% extends "base.html" %} {% from "_macros.html" import wf_badge, attachments_card with context %} {% block title %}{{ s.number }}{% endblock %} {% block content %} {% set cur = branch.currency %}
{{ t(info.label) }}

{{ s.number }} {{ wf_badge(s.state) }}

{{ s.name }}
{% if s.invoice_id %}{{ s.inv_number }}{% endif %} {% if can_write %} {% if s.state == 'draft' %} {{ t('Edit') }}
{% endif %} {% if s.state in ('draft', 'running') and not recognized %}
{% endif %} {% if s.state == 'cancelled' %}
{% endif %} {% endif %}
{{ t('Total') }}
{{ s.total|money(cur) }}
{{ cur }} · {{ s.months }} {{ t('months') }}
{{ t('Recognized') }}
{{ recognized|money(cur) }}
{{ cur }}
{{ t('Remaining') }}
{{ (s.total - recognized)|money(cur) }}
{{ cur }}
{{ t('Branch') }}
{{ branch.code }} — {{ nm(branch) }}
{{ t('Partner') }}
{{ nm({'name_en': s.pname_en, 'name_ar': s.pname_ar}) if s.pname_en else '—' }}
{{ t(info.balance) }}
{{ s.bcode }} {{ nm({'name_en': s.bname_en, 'name_ar': s.bname_ar}) }}
{{ t(info.pl) }}
{{ s.pcode }} {{ nm({'name_en': s.plname_en, 'name_ar': s.plname_ar}) }}
{% if s.kind == 'accrual' %}
{{ t('Automatic reversal') }}
{{ t('Yes') if s.auto_reverse else t('No') }}
{% endif %}
{% if can_write and s.state == 'running' %}
{% endif %}
{% if s.kind == 'accrual' and s.auto_reverse %}{% endif %} {% for l in lines %} {% if s.kind == 'accrual' and s.auto_reverse %}{% endif %} {% endfor %} {% for d, amt in preview %}{% endfor %}
{{ t('Date') }}{{ t('Amount') }}{{ t('Entry') }}{{ t('Reversal') }}
{{ l.date }}{{ l.amount|money(cur) }} {% if l.move_id %}{{ t('Posted') }}{% endif %}{% if l.reversal_move_id %}{{ t('Posted') }}{% endif %}
{{ d }}{{ amt|money(cur) }}{{ t('preview') }}
{{ attachments_card('prepaid', s.id) }} {% endblock %}