diff --git a/resources/twig/budgets/show.twig b/resources/twig/budgets/show.twig index cf2734d3f6..fe73f71354 100644 --- a/resources/twig/budgets/show.twig +++ b/resources/twig/budgets/show.twig @@ -50,6 +50,7 @@ {% for limit in limits %} {% for rep in limit.limitRepetitions %} + {% set spentInRep = (spentInRepetitionCorrected(rep)*-1) %}

{{ rep.startdate.formatLocalized(monthFormat) }} @@ -61,15 +62,15 @@ {{ 'amount'|_ }}: {{ rep.amount|formatAmount }}

- {{ 'spent'|_ }}: {{ spentInRepetitionCorrected(rep)|formatAmount }} + {{ 'spent'|_ }}: {{ spentInRep|formatAmountPlain }}
- {% set overspent = spentInRepetitionCorrected(rep) > rep.amount %} + {% set overspent = spentInRep > rep.amount %} + {% if overspent %} - {% set spent = spentInRepetitionCorrected(rep) %} - {% set pct = (spent != 0 ? (rep.amount / spent)*100 : 0) %} + {% set pct = (spentInRep != 0 ? (rep.amount / spent)*100 : 0) %}
@@ -78,7 +79,7 @@
{% else %} {% set amount = rep.amount %} - {% set pct = (amount != 0 ? (spentInRepetitionCorrected(rep) / amount)*100 : 0) %} + {% set pct = (amount != 0 ? spentInRep / amount)*100 : 0) %}