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

{{ t('Credit Control') }}

{{ t('What each customer owes against its credit limit, and overdue invoices to chase.') }} {{ t('Policy') }}: {{ t('stop the sale') if policy == 'block' else t('warn only') }}{% if overdue_days %} · {{ t('stop when overdue more than') }} {{ overdue_days }} {{ t('days') }}{% endif %} {% if is_admin %} · {{ t('Change') }}{% endif %}
{{ t('Receivable balance') }}
{{ totals.balance|money(cur) }} {{ cur }}
{{ t('Orders not yet invoiced') }}
{{ totals.orders|money(cur) }} {{ cur }}
{{ t('Overdue') }}
{{ totals.overdue|money(cur) }} {{ cur }}
{% for code, lbl in [('attention', 'Needs attention'), ('limits', 'With a limit or overdue'), ('all', 'All customers')] %} {{ t(lbl) }} {% endfor %}
{% set limits = rows|selectattr('limit')|list|length > 0 %}
{% if can_write %}{% endif %} {% if limits %}{% endif %} {% for r in rows %} {% if can_write %}{% endif %} {% if limits %}{% endif %} {% else %}{% endfor %}
{{ t('Customer') }}{{ t('Credit limit') }}{{ t('Balance') }}{{ t('Open orders') }}{{ t('Used') }}{{ t('Available') }}{{ t('Overdue') }}{{ t('Oldest') }} {{ t('Last reminder') }}{{ t('Status') }}
{% if r.ex.overdue > 0 %}{% endif %}{{ nm(r.p) }} {% if can_write %} ✎{% endif %} {{ r.limit|money(cur) if r.limit else '—' }} {{ r.ex.balance|money(cur) }}{{ r.ex.orders|money(cur, true) }}{% if r.limit %}
{{ r.used|round(0)|int }}%{% endif %}
{{ r.available|money(cur) if r.available is not none else '' }}{{ r.ex.overdue|money(cur, true) }} {{ r.ex.oldest_days ~ ' ' ~ t('days') if r.ex.oldest_days else '' }} {{ last[r.p.id].replace('T', ' ')[:10] if r.p.id in last else '' }} {{ t({'hold': 'On hold', 'over': 'Over limit', 'late': 'Long overdue', 'overdue': 'Overdue', 'ok': 'OK'}[r.status]) }}
{{ t('Nothing needs attention.') }}
{% if can_write and rows %}
{{ t('The wording gets firmer as invoices get older: a friendly reminder, a second reminder after 30 days, a final notice after 60.') }}
{% endif %}

{{ t('Amounts in') }} {{ cur }}{{ t(', other currencies translated at today\'s rate.') }} {{ t('Set the credit limit and hold on each customer.') }}

{% endblock %} {% block scripts %} {% endblock %}