Fixed a chart [skip ci]

This commit is contained in:
James Cole 2015-05-20 06:50:24 +02:00
parent 42b49d0e4b
commit 7a0ad5a587
2 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ $(function () {
if (typeof budgetID !== 'undefined' && typeof repetitionID === 'undefined') {
googleColumnChart('chart/budget/' + budgetID + '/spending', 'budgetOverview');
googleColumnChart('chart/budget/' + budgetID, 'budgetOverview');
}
if (typeof budgetID !== 'undefined' && typeof repetitionID !== 'undefined') {
googleLineChart('chart/budget/' + budgetID + '/' + repetitionID, 'budgetOverview');

View File

@ -51,14 +51,14 @@
Amount: {{ rep.amount|formatAmount }}
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
Spent: {{ spentInRepetition(rep)|formatAmount }}
Spent: {{ spentInRepetitionCorrected(rep)|formatAmount }}
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
{% set overspent = spentInRepetition(rep) > rep.amount %}
{% set overspent = spentInRepetitionCorrected(rep) > rep.amount %}
{% if overspent %}
{% set spent = spentInRepetition(rep) %}
{% set spent = spentInRepetitionCorrected(rep) %}
{% set pct = (spent != 0 ? (rep.amount / spent)*100 : 0) %}
<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>
@ -66,7 +66,7 @@
</div>
{% else %}
{% set amount = rep.amount %}
{% set pct = (amount != 0 ? (spentInRepetition(rep) / amount)*100 : 0) %}
{% set pct = (amount != 0 ? (spentInRepetitionCorrected(rep) / amount)*100 : 0) %}
<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>
</div>