{% extends "base.html" %} {% block title %}Budget - Fin{% endblock %} {% block content %}
{% if total_budget_cents > 0 %}
Monthly Budget {{ period_start }} to {{ period_end }}
Budget ${{ "%.0f"|format(total_budget_cents / 100) }}
Spent ${{ "%.0f"|format(total_spent_cents / 100) }}
Remaining {% set remaining = total_budget_cents - total_spent_cents %} {{ '-' if remaining < 0 else '' }}${{ "%.0f"|format((remaining if remaining >= 0 else -remaining) / 100) }}
{% set pct = [total_percent, 100]|min %}
{{ total_percent }}% used
{% endif %}
Category Budgets
{% set has_budgeted = [] %} {% set has_unbudgeted = [] %} {% for row in budget_rows %} {% if row.target_cents > 0 %} {% if has_budgeted.append(1) %}{% endif %} {% else %} {% if has_unbudgeted.append(1) %}{% endif %} {% endif %} {% endfor %} {% if not budget_rows %}

No budget targets set

Add a target below to start tracking your spending against goals.

{% endif %} {% for row in budget_rows %} {% if row.target_cents > 0 %}
{{ row.category.icon }} {{ row.category.name }}
{% set pct = [row.percent, 100]|min %}
${{ "%.0f"|format(row.spent_cents / 100) }} / ${{ "%.0f"|format(row.target_cents / 100) }}
{{ "%.0f"|format(row.percent) }}%
{% endif %} {% endfor %} {% if has_unbudgeted %}
Unbudgeted spending
{% for row in budget_rows %} {% if row.target_cents == 0 and row.spent_cents > 0 %}
{{ row.category.icon }} {{ row.category.name }}
${{ "%.0f"|format(row.spent_cents / 100) }} no target
--
{% endif %} {% endfor %} {% endif %}
$ /mo
{% endblock %}