Small updates to icons and code.

This commit is contained in:
James Cole 2015-03-07 12:34:03 +01:00
parent 081ff3ff55
commit c3990ac32f
3 changed files with 8 additions and 7 deletions

View File

@ -69,7 +69,7 @@ class JsonController extends Controller
// paid a bill in this range?
$count = $bill->transactionjournals()->before($range['end'])->after($range['start'])->count();
if ($count == 0) {
$amount += ($bill->amount_max + $bill->amount_min / 2);
$amount += floatval($bill->amount_max + $bill->amount_min / 2);
}
@ -104,7 +104,7 @@ class JsonController extends Controller
}
}
return Response::json(['box' => $box, 'amount' => Amount::format($amount, false)]);
return Response::json(['box' => $box, 'amount' => Amount::format($amount, false),'amount_raw' => $amount]);
}
/**

View File

@ -14,8 +14,9 @@ function getBoxAmounts() {
for (x in boxes) {
var box = boxes[x];
$.getJSON('/json/box', {box: box}).success(function (data) {
"use strict";
$('#box-' + data.box).html(data.amount);
if(data.amount_raw != 0) {
$('#box-' + data.box).html(data.amount);
}
}).fail(function () {
console.log('Failed to get box!')
});

View File

@ -5,7 +5,7 @@
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-cloud-upload fa-5x"></i>
<i class="fa fa-upload fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div id="box-out" class="large">{{Amount::format(0,false)}}</div>
@ -27,7 +27,7 @@
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-cloud-download fa-5x"></i>
<i class="fa fa-download fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div id="box-in" class="large">{{Amount::format(0,false)}}</div>
@ -49,7 +49,7 @@
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-calendar-o fa-5x"></i>
<i class="fa fa-calendar fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div id="box-bills-unpaid" class="large">{{Amount::format(0,false)}}</div>