{% extends "base.html" %} {% from "_macros.html" import status_chip %} {% block title %}Rules · {{ current.name }} — rwa-filer dash{% endblock %} {% block content %} {% set base = "/returns/" ~ current.return_id ~ "/rules" %} {% set grid_url = "/returns/" ~ current.return_id ~ "/templates" %} {% set labels = {"FAIL": "Failed", "PASS": "Passed", "NOT_EVALUATED": "Not evaluated"} %}
Rules

{{ "Why the return is blocked" if not current.validation.is_submittable and view.counts["FAIL"] else "The published rules" }}

{{ (view.counts.values() | sum) | count }} rules enforced for {{ current.ret.header.module }}, evaluated the way the taxonomy's XBRL formulas evaluate them. Pick a rule to see the cells it read.

{% if view.status == "FAIL" %} {% endif %}
{{ view.matched | count }} {{ labels[view.status] | lower }} rule{{ "s" if view.matched != 1 }}{% if view.pages > 1 %} · page {{ view.page }} of {{ view.pages }}{% endif %}
{% if view.rows %} {% if view.pages > 1 %}
{% if view.page > 1 %}Previous{% endif %} {% if view.page < view.pages %}Next{% endif %}
{% endif %} {% else %}

No rule matches.{% if view.status == "FAIL" and not view.query and not view.template %} Nothing is broken.{% endif %}

{% endif %}
{% if view.selected %} {% set rule = view.selected %}
{{ status_chip(rule.row) }}{{ rule.row.rule_id }} {{ rule.row.templates | join(" · ") }}

{{ rule.row.label or "No label published" }}

Evaluations that hold
{{ rule.row.satisfied | count }}
Evaluations that break
{{ rule.row.unsatisfied | count }}
{% if rule.row.status == "NOT_EVALUATED" %}
Not evaluated because
{{ rule.row.reason }}
{{ rule.reason_text }}{% if rule.detail %}: {{ rule.detail }}{% endif %}
{% endif %}
{% if rule.expression %}

The rule, as the Bank's workbook states it

{{ rule.expression }}
{% if rule.scope %}

Scope

{{ rule.scope }}
{% endif %}
{% endif %} {% if rule.failures %}

Where it breaks{% if rule.row.unsatisfied > rule.failures | length %} — the first {{ rule.failures | length }} of {{ rule.row.unsatisfied }}{% endif %}

{% for failure in rule.failures %}
{{ "At " ~ failure.place if failure.place else "One evaluation over the whole template" }}
    {% for cell in failure.cells %}
  • {{ cell }}
  • {% endfor %}
{% if failure.addresses %}
{% for address in failure.addresses[:24] %} {{ address.table }}{% if address.sheet %} z{{ address.sheet }}{% endif %}{% if address.open_key %} {{ address.open_key }}{% endif %} r{{ address.row }} c{{ address.column }} {% endfor %} {% if failure.addresses | length > 24 %}and {{ failure.addresses | length - 24 }} more{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endblock %}