First attempt at unifying code for categories and budgets, which are basically the same thing.

This commit is contained in:
Sander Dorigo
2014-11-10 21:55:22 +01:00
parent af9473c126
commit 9fa326f630
11 changed files with 417 additions and 393 deletions

View File

@@ -8,12 +8,15 @@ $(function () {
if (typeof(googleTable) == 'function') {
if (typeof budgetID != 'undefined' && typeof repetitionID == 'undefined') {
googleTable('table/budget/' + budgetID + '/0/transactions', 'transactions');
googleColumnChart('chart/budgets/'+budgetID+'/spending/2014','budgetOverview');
console.log('A');
if (typeof componentID != 'undefined' && typeof repetitionID == 'undefined') {
console.log('B');
googleTable('table/component/' + componentID + '/0/transactions', 'transactions');
googleColumnChart('chart/component/' + componentID + '/spending/' + year, 'componentOverview');
} else if (typeof budgetID != 'undefined' && typeof repetitionID != 'undefined') {
googleTable('table/budget/' + budgetID + '/' + repetitionID + '/transactions', 'transactions');
} else if (typeof componentID != 'undefined' && typeof repetitionID != 'undefined') {
console.log('C');
googleTable('table/component/' + componentID + '/' + repetitionID + '/transactions', 'transactions');
}
}
@@ -162,7 +165,6 @@ function updateRanges() {
// we gaan er X overheen,
var pct = totalAmount / sum * 100;
console.log(pct)
var danger = 100 - pct;
var err = 100 - danger;
$('#progress-bar-default').css('width', 0);