{% extends 'base.html.twig' %} {% block title %}Savings{% endblock %} {% block content %} {% set totalRemaining = totalTarget - totalSaved %} {% set overallPct = totalTarget > 0 ? ((totalSaved / totalTarget) * 100)|round(1) : 0 %}
Total Saved
£{{ totalSaved|number_format(2) }}
{{ overallPct }}% of target · {{ goals|length }} goal{{ goals|length != 1 ? 's' : '' }}
Still to save
£{{ totalRemaining > 0 ? totalRemaining|number_format(2) : '0.00' }}
Target £{{ totalTarget|number_format(2) }}
{% if monzoPots|length > 0 %}
Monzo Pots
{% for pot in monzoPots %}
{{ pot.name }}
£{{ (pot.balance / 100)|number_format(2) }}
{% if pot.goal_amount is defined and pot.goal_amount > 0 %}
Goal: £{{ (pot.goal_amount / 100)|number_format(2) }}
{% else %}
Monzo pot
{% endif %}
{% endfor %}
{% endif %} {% if goals|length > 0 %}
{% for goal in goals %}

{{ goal.name }}

{% if goal.institution %} 🏦 {{ goal.institution }} {% endif %}
{{ goal.progressPercent }}% Edit
{% if goal.description %}

{{ goal.description }}

{% endif %} {% if goal.linkedExpenseDescription %}
🔗 Auto-syncs: {{ goal.linkedExpenseDescription }}
{% endif %}
£{{ goal.currentAmount|number_format(2) }} / £{{ goal.targetAmount|number_format(2) }}
{% if goal.deadline %} 🎯 {{ goal.deadline|date("d M Y") }} {% endif %}
{% if goal.monthlyContribution %}
💰 £{{ goal.monthlyContribution|number_format(2) }}/month {% if (goal.targetAmount - goal.currentAmount) > 0 and goal.monthlyContribution > 0 %} · ~{{ ((goal.targetAmount - goal.currentAmount) / goal.monthlyContribution)|round(0, 'ceil') }} months left {% endif %}
{% endif %} {# Deposit + Withdraw forms #}
{% if recentExpenses|length > 0 %}
{% endif %}
{% if goal.entries|length > 0 %}
History ({{ goal.entries|length }})
    {% for entry in goal.entries|slice(0, 10) %}
  • {{ entry.date|date("d M") }} {{ entry.user.name }} {{ entry.amount < 0 ? '−' : '+' }}£{{ entry.amount|abs|number_format(2) }} {% if entry.linkedExpense %}🔗 {{ entry.linkedExpense.description }}{% endif %} {% if entry.note %}{{ entry.note }}{% endif %}
  • {% endfor %}
{% endif %}
{% endfor %}
{% else %}

No savings goals yet. Start saving towards something! 🎯

Create a goal
{% endif %} {% endblock %}