From e044199693b3b1ec9ee3595f94398e8a08c00836 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 12 Dec 2015 08:14:17 +0100 Subject: [PATCH] Spent amount / withdrawals are negative, #129. --- resources/twig/budgets/show.twig | 4 ++-- resources/twig/list/piggy-bank-events.twig | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/twig/budgets/show.twig b/resources/twig/budgets/show.twig index 4f1decf607..63f1e90c32 100644 --- a/resources/twig/budgets/show.twig +++ b/resources/twig/budgets/show.twig @@ -70,7 +70,7 @@ {% set overspent = rep.amount + spentInRep < 0 %} {% if overspent %} - {% set pct = (spentInRep != 0 ? (rep.amount / (spentInRep*-1))*100 : 0) %} + {% set pct = (spentInRep != 0 ? (rep.amount / (spentInRep*-1))*100 : 0) %}
@@ -79,7 +79,7 @@
{% else %} {% set amount = rep.amount %} - {% set pct = (amount != 0 ? (((spentInRep*-1) / amount)*100) : 0) %} + {% set pct = (amount != 0 ? (((spentInRep*-1) / amount)*100) : 0) %}
diff --git a/resources/twig/list/piggy-bank-events.twig b/resources/twig/list/piggy-bank-events.twig index b6e7ffa8b5..14761b5007 100644 --- a/resources/twig/list/piggy-bank-events.twig +++ b/resources/twig/list/piggy-bank-events.twig @@ -24,10 +24,8 @@ {% if event.amount < 0 %} - - {{ trans('firefly.removed_amount', {amount: (event.amount*-1)|formatAmountPlain})|raw }} + {{ trans('firefly.removed_amount', {amount: (event.amount)|formatAmountPlain})|raw }} {% else %} - {{ trans('firefly.added_amount', {amount: (event.amount)|formatAmountPlain})|raw }} {% endif %}