{% extends "base.html" %} {% block title %}Approvals{% endblock %} {% block header %}Approvals{% endblock %} {% block content %} {% set show_waiting = (request.args.get('show_waiting') in ['1','true','yes','on']) %} {% macro money(v) -%} {%- if v is none -%}0.00 {%- else -%} {%- set s = v|string -%} {%- set s = s|replace(",", "") -%} {%- if s == "" -%}0.00{%- else -%}{{ "%.2f"|format(s|float) }}{%- endif -%} {%- endif -%} {%- endmacro %}

Approval Inbox

Quotes waiting for your approval (user or role mapping • sequential).
{% if show_waiting %} Show Pending Only {% else %} Show Pending + Waiting {% endif %} Pending: {{ items | selectattr("status", "equalto", "PENDING") | list | length }} {% if show_waiting %} Waiting: {{ items | selectattr("status", "equalto", "WAITING") | list | length }} {% endif %}
{% for a in items %} {% set opp = a.quote.opportunity if a.quote else None %} {% endfor %} {% if items|length == 0 %} {% endif %}
Quote Opportunity Total Rule Step Assigned To Status Action
{% if a.quote %} {{ a.quote.quote_code }}
V{{ a.quote.version }}
{% else %} — {% endif %}
{% if opp %}
{{ opp.opp_code }}
{{ opp.title }}
{% else %}
—
{% endif %}
{% if a.quote %} {{ money(a.quote.total) }} {% else %} 0.00 {% endif %}
{{ a.rule.name if a.rule else '—' }}
{% if a.rule and (a.rule.min_amount is not none or a.rule.max_amount is not none) %}
Min: {{ money(a.rule.min_amount or 0) }} • Max: {{ money(a.rule.max_amount) if a.rule.max_amount is not none else '∞' }}
{% endif %}
#{{ a.step_order or 1 }} {% if a.approver_user %} {{ a.approver_user.name }}
User-mapped
{% else %} {{ a.approver_role or '—' }}
Role-mapped
{% endif %}
{% if a.status == "PENDING" %} PENDING {% elif a.status == "WAITING" %} WAITING {% elif a.status == "APPROVED" %} APPROVED {% elif a.status == "REJECTED" %} REJECTED {% elif a.status == "CANCELLED" %} CANCELLED {% else %} {{ a.status }} {% endif %} {% if a.status == "PENDING" %}
{# CSRF if you have Flask-WTF; harmless otherwise #} {% if csrf_token is defined %} {% endif %}
{% else %} No action required {% endif %}
{% if show_waiting %} No pending/waiting approvals 🎉 {% else %} No pending approvals 🎉 {% endif %}
{% endblock %}