{% extends "base.html" %} {% load humanize erp_tags %} {% block title %}{{ page_title }}{% endblock %} {% block content %} {% if not company %}
Several companies exist and none was selected. Append ?company=<uuid> to choose one.
{% else %}
Trial Balance

{{ company.name }} {% if date_from or date_to %}· {{ date_from|default:"start" }} → {{ date_to|default:"today" }}{% else %}· all dates{% endif %}

{% if q_company %}{% endif %}
CSV
{% for row in rows %} {% empty %} {% endfor %} {% comment %} Footer totals are the ledger-wide figures from the database, NOT a sum of the rows above — the rows may be filtered by type. {% endcomment %}
# Account Type Debit Credit Balance
{{ row.account_number|default:"—" }} {{ row.full_name|default:row.name }} {% if not row.is_active %}placeholder{% endif %} {{ row.get_account_type_display }} {% if row.debit %}{{ row.debit|money }}{% else %}—{% endif %} {% if row.credit %}{{ row.credit|money }}{% else %}—{% endif %} {{ row.balance|money }}
No accounts with activity{% if not show_empty %} — show zero-activity accounts{% endif %}.
Ledger total{% if account_type %} (all types — rows above are filtered){% endif %} {{ total_debit|money }} {{ total_credit|money }} {% if out_of_balance %}{{ out_of_balance|money }} out{% else %}in balance{% endif %}
{% endif %} {% include "erp/_list_a11y_script.html" %} {% endblock %}