Spent amount / withdrawals are negative, #129.

This commit is contained in:
James Cole 2015-12-12 08:14:17 +01:00
parent 8f8e29fc22
commit e044199693
2 changed files with 3 additions and 5 deletions

View File

@ -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) %} <!-- must have -1 here -->
<div class="progress progress-striped">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="{{ pct|round }}" aria-valuemin="0"
aria-valuemax="100" style="width: {{ pct|round }}%;"></div>
@ -79,7 +79,7 @@
</div>
{% else %}
{% set amount = rep.amount %}
{% set pct = (amount != 0 ? (((spentInRep*-1) / amount)*100) : 0) %}
{% set pct = (amount != 0 ? (((spentInRep*-1) / amount)*100) : 0) %} <!-- must have -1 here -->
<div class="progress progress-striped">
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="{{ pct|round }}" aria-valuemin="0"
aria-valuemax="100" style="width: {{ pct|round }}%;"></div>

View File

@ -24,10 +24,8 @@
<td>
{% if event.amount < 0 %}
<span class="text-danger">{{ trans('firefly.removed_amount', {amount: (event.amount*-1)|formatAmountPlain})|raw }}</span>
<span class="text-danger">{{ trans('firefly.removed_amount', {amount: (event.amount)|formatAmountPlain})|raw }}</span>
{% else %}
<span class="text-success">{{ trans('firefly.added_amount', {amount: (event.amount)|formatAmountPlain})|raw }}</span>
{% endif %}
</td>