{% extends "base.html" %} {% from "components/ui.html" import page_header, empty_state %} {% block title %}{{ _('Pending Approvals') }} - {{ app_name }}{% endblock %} {% block content %} {% set breadcrumbs = [ {'text': 'Invoice Approvals'} ] %} {{ page_header( icon_class='fas fa-check-circle', title_text='Pending Approvals', subtitle_text='Invoices awaiting your approval', breadcrumbs=breadcrumbs ) }}
{% if approvals %}
{% for approval in approvals %}

{{ _('Invoice') }} #{{ approval.invoice.invoice_number }}

{{ _('Requested by') }}: {{ approval.requester.username }} • {{ _('Stage') }} {{ approval.current_stage + 1 }}/{{ approval.total_stages }}

{% if approval.stages and approval.current_stage < approval.stages|length %}

{{ _('Current Approver') }}: {% set current_stage = approval.stages[approval.current_stage] %} {% if current_stage.get('approver_id') == current_user.id %} {{ _('You') }} {% else %} {{ User.query.get(current_stage.get('approver_id')).username if User.query.get(current_stage.get('approver_id')) else _('Unknown') }} {% endif %}

{% endif %}
{% endfor %}
{% else %} {{ empty_state( 'fas fa-check-circle', _('No Pending Approvals'), _('You have no invoices awaiting your approval.'), type='no-data' ) }} {% endif %}
{% endblock %}