{% extends "core/base.html" %} {% block title %}{{ vendor.name }}{% endblock %} {% block content %}

{{ vendor.name }} {{ vendor.code }}

{{ stats.spend|floatformat:0 }}Spend (non-rejected)
{{ stats.invoices }}Invoices
{{ stats.exception_rate|floatformat:0 }}%Exception rate{{ stats.with_exceptions }} with exceptions
{{ vendor.payment_terms_days }} dTerms{% if vendor.discount_pct %}{{ vendor.discount_pct }}/{{ vendor.discount_days }} early pay{% else %}no discount{% endif %}

Benford first-digit test

{% for b in chart.bars %} Digit {{ b.digit }}: {{ b.count }} invoices {{ b.digit }} {% endfor %}

Bars: observed share. Line: Benford expectation. n={{ test.n }}, chi²={{ test.chi2|floatformat:1 }}, p={{ test.p_value|floatformat:4 }}. {% if test.flagged %}anomaly (p < 0.01){% elif test.n < 30 %}sample too small (< 30){% else %}consistent{% endif %}

Bank details

{% for b in banks %}{% endfor %}
{{ b.effective_from }}{{ b.bank_name }}{{ b.account_no }}{{ b.ifsc }}

Exceptions by type

{% for label, n in exc_by_type %}
{{ label }}: {{ n }}
{% empty %}

None.

{% endfor %}

Recent invoices

{% for i in invoices %}{% endfor %}
InvoiceDateTotalStatusOpen exc.
{{ i.invoice_no }}{{ i.invoice_date }}{{ i.total }}{{ i.get_status_display }}{{ i.open_exc }}
{% endblock %}