{% extends "base.html" %} {% from "_macros.html" import export_buttons, indent, level_select with context %} {% block title %}{{ t('Budget vs Actual') }}{% endblock %} {% block content %}
{{ t('Budgets') }}

{{ t('Budget vs Actual') }} — {{ b.name }}

{{ fy }} · {{ b.bcode }}{% if b.cc_code %} · {{ t('Cost Centre') }} {{ b.cc_code }} {{ nm({'name_en': b.cc_name_en, 'name_ar': b.cc_name_ar}) }}{% else %} · {{ t('Whole branch') }}{% endif %}
{% if can_write %}
{{ t('Edit budget') }} {{ t('Copy') }}
{% endif %}
{% for code, lbl in [('month', 'Month'), ('ytd', 'Year to date'), ('year', 'Full year')] %} {% endfor %}
{% if scope != 'year' %}{% else %}{% endif %} {% if levels > 1 %}{{ level_select(level, levels) }}{% endif %} {{ export_buttons() }}
{{ data.periods[0] }}{% if data.periods|length > 1 %} → {{ data.periods[-1] }}{% endif %} {{ t('Amounts in') }} {{ cur }}
{% for r in data.rows %} {% if r.kind == 'section' %} {% else %} {% endif %} {% endfor %}
{{ t('Account') }}{{ t('Budget') }}{{ t('Actual') }} {{ t('Variance') }}{{ t('% of budget') }}
{{ r.label }}
{% if r.account %}{{ r.account.code }} {{ nm(r.account) }}{% else %}{{ r.label }}{% endif %} {{ r.budget|money(cur) }} {{ r.actual|money(cur) }} {{ ('+' if r.variance > 0 else '') ~ r.variance|money(cur) if r.variance else '—' }} {{ '%.0f'|format(r.pct) ~ '%' if r.pct is not none else '' }} {% if r.pct is not none and r.kind != 'section' %}
{% endif %}
{{ t('Variance = actual − budget. Green is favourable (income above budget, costs below budget); red is unfavourable.') }}
{% endblock %}