{% extends "base.html" %} {% from "_macros.html" import failure_card, rule_text, 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 %}
{{ rule_text(rule) }} {% 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 %}{{ failure_card(failure, grid_url, rule.row.rule_id) }}{% endfor %}
{% endif %}
{% endif %}
{% endblock %}