{% extends "base.html" %} {% from "components/cards.html" import info_card, stat_card %} {% from "components/ui.html" import page_header, breadcrumb_nav, button, filter_badge %} {% block content %} {% set breadcrumbs = [ {'text': _('Budget Alerts')} ] %} {{ page_header( icon_class='fas fa-exclamation-triangle', title_text=_('Budget Alerts & Forecasting'), subtitle_text=_('Monitor project budgets and forecast completion'), breadcrumbs=breadcrumbs, actions_html='' + '
' + '' + _('Reports') + '' + '' + '
' ) }}

{{ alert_stats.total_unacknowledged }}

{{ _('Unacknowledged Alerts') }}

{{ alert_stats.critical_alerts }}

{{ _('Critical Alerts') }}

{{ projects|length }}

{{ _('Projects with Budgets') }}

{{ alert_stats.warning_alerts }}

{{ _('Warning Alerts') }}

{% if active_alerts %}

{{ _('Active Alerts') }}

{% for alert in active_alerts %}
{% if alert.alert_level == 'critical' %} {% elif alert.alert_level == 'warning' %} {% else %} {% endif %}

{{ alert.project.name }}

{{ alert.message }}

{{ _('Created') }}: {{ alert.created_at|user_datetime('%Y-%m-%d %H:%M') }}

{{ _('View') }}
{% endfor %}
{% endif %}

{{ _('Project Budget Status') }}

{% for project in projects %} {% else %} {% endfor %}
{{ _('Project') }} {{ _('Budget') }} {{ _('Consumed') }} {{ _('Remaining') }} {{ _('Progress') }} {{ _('Status') }} {{ _('Actions') }}
{{ project.project_name }} ${{ "%.2f"|format(project.budget_amount) }} ${{ "%.2f"|format(project.consumed_amount) }} {% if project.remaining_amount >= 0 %} ${{ "%.2f"|format(project.remaining_amount) }} {% else %} ${{ "%.2f"|format(project.remaining_amount|abs) }} {{ _('over') }} {% endif %}
{{ "%.1f"|format(project.consumed_percentage) }}%
{% if project.status == 'over_budget' %} {{ _('Over Budget') }} {% elif project.status == 'critical' %} {{ _('Critical') }} {% elif project.status == 'warning' %} {{ _('Warning') }} {% else %} {{ _('Healthy') }} {% endif %} {{ _('Details') }}

{{ _('No projects with budgets found') }}

{% endblock %}