{% extends "base.html" %} {% block title %}{{ rec.name }}{% endblock %} {% block content %} {% set cur = branch.currency %}
{{ t('Recurring Documents') }} · {{ t(kinds[rec.kind]) }}

{{ rec.name }} {{ t(rec.state|capitalize) }}

{% if can_write %}
{% if rec.state == 'active' and rec.next_date and rec.next_date <= today %}
{% endif %} {{ t('Edit') }} {% if rec.state == 'active' %}
{% elif rec.state == 'paused' %}
{% endif %} {% if not rec.done_count %}
{% endif %}
{% endif %}
{% if rec.last_error %}
{{ icon('alert') }}{{ t('Last attempt failed') }}: {{ rec.last_error }}
{% endif %}
{% if rec.partner_id %}
{{ t('Customer') if rec.kind == 'out_invoice' else t('Vendor') }}
{{ nm({'name_en': rec.pname_en, 'name_ar': rec.pname_ar}) }}
{% endif %}
{{ t('Branch') }}
{{ branch.code }} — {{ nm(branch) }}
{{ t('Journal') }}
{{ rec.jcode }}
{{ t('Repeat') }}
{{ t('every') }} {{ rec.every if rec.every > 1 else '' }} {{ t({'weekly': 'week(s)', 'monthly': 'month(s)', 'quarterly': 'quarter(s)', 'yearly': 'year(s)'}[rec.frequency]) }} · {{ t('from') }} {{ rec.start_date }}
{{ t('Ends') }}
{% if rec.end_date %}{{ rec.end_date }}{% elif rec.max_count %}{{ t('after') }} {{ rec.max_count }} {{ t('documents') }}{% else %}{{ t('Until stopped') }}{% endif %}
{{ t('Amount') }}
{{ amount|money(cur) }} {{ cur }}
{{ t('When created') }}
{{ t('Posted') if rec.auto_post else t('Draft') }}{% if rec.auto_email %} · {{ t('emailed to the customer') }}{% endif %}
{% if rec.ref %}
{{ t('Reference') }}
{{ rec.ref }}
{% endif %}

{{ t('Lines') }}

{% if rec.kind == 'entry' %} {% for l in lines %}{% endfor %} {% else %} {% for l in lines %}{% endfor %} {% endif %}
{{ t('Account') }}{{ t('Partner') }}{{ t('Label') }}{{ t('Debit') }}{{ t('Credit') }}
{{ l.code }} {{ nm({'name_en': l.aname_en, 'name_ar': l.aname_ar}) }}{% if l.cc_code %} {{ l.cc_code }}{% endif %}{{ nm({'name_en': l.pname_en, 'name_ar': l.pname_ar}) if l.pname_en else '' }} {{ l.description or '' }}{{ l.debit|money(cur, true) }}{{ l.credit|money(cur, true) }}
{{ t('Description') }}{{ t('Account') }}{{ t('Qty') }}{{ t('Unit Price') }}{{ t('Tax') }}
{{ l.description or '' }}{{ l.code }} {{ nm({'name_en': l.aname_en, 'name_ar': l.aname_ar}) }}{% if l.cc_code %} {{ l.cc_code }}{% endif %} {{ '%g' % l.quantity }}{{ l.price_unit|money(cur) }}{{ nm({'name_en': l.tname_en, 'name_ar': l.tname_ar}) if l.tname_en else '' }}

{{ t('Next dates') }}

{% if upcoming and rec.state != 'done' %} {% else %}

{{ t('No more documents will be created.') }}

{% endif %}

{{ t('Documents created') }} {{ runs|length }}

{% for r in runs %} {% if r.model == 'invoice' %} {% else %} {% endif %} {% else %}{% endfor %}
{{ t('Date') }}{{ t('Document') }}{{ t('Amount') }}{{ t('Status') }}
{{ r.date }}{{ r.inv_number or t('Draft') }} {{ (r.amount_total or 0)|money(cur) }}{{ t((r.inv_state or 'deleted')|capitalize) }}
{{ r.date }}{{ r.move_name or t('Draft') }} {{ amount|money(cur) }}{{ t((r.move_state or 'deleted')|capitalize) }}
{{ t('Nothing yet.') }}
{% endblock %}