2016-10-26 19:45:10 +02:00
|
|
|
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds, lineChart, categoryReportUrl, balanceReportUrl */
|
2015-12-04 06:56:59 +01:00
|
|
|
|
2015-06-27 16:00:50 +02:00
|
|
|
|
|
|
|
$(function () {
|
|
|
|
"use strict";
|
2015-08-01 07:22:48 +02:00
|
|
|
drawChart();
|
2016-10-26 16:46:43 +02:00
|
|
|
|
|
|
|
loadCategoryReport();
|
2016-10-26 19:45:10 +02:00
|
|
|
loadBalanceReport();
|
2015-06-27 16:00:50 +02:00
|
|
|
});
|
2015-03-04 20:47:00 +01:00
|
|
|
|
2016-10-26 16:46:43 +02:00
|
|
|
function loadCategoryReport() {
|
|
|
|
"use strict";
|
|
|
|
console.log('Going to grab ' + categoryReportUrl);
|
|
|
|
$.get(categoryReportUrl).done(placeCategoryReport).fail(failCategoryReport);
|
|
|
|
}
|
|
|
|
|
2016-10-26 19:45:10 +02:00
|
|
|
function loadBalanceReport() {
|
|
|
|
"use strict";
|
|
|
|
console.log('Going to grab ' + categoryReportUrl);
|
|
|
|
$.get(balanceReportUrl).done(placeBalanceReport).fail(failBalanceReport);
|
|
|
|
}
|
|
|
|
|
|
|
|
function placeBalanceReport(data) {
|
|
|
|
"use strict";
|
|
|
|
$('#balanceReport').removeClass('loading').html(data);
|
|
|
|
listLengthInitial();
|
|
|
|
triggerInfoClick();
|
|
|
|
}
|
|
|
|
|
2016-10-26 16:46:43 +02:00
|
|
|
function placeCategoryReport(data) {
|
|
|
|
"use strict";
|
|
|
|
$('#categoryReport').removeClass('loading').html(data);
|
|
|
|
listLengthInitial();
|
|
|
|
triggerInfoClick();
|
|
|
|
}
|
|
|
|
|
2016-10-26 19:45:10 +02:00
|
|
|
function failBalanceReport() {
|
|
|
|
"use strict";
|
|
|
|
console.log('Fail balance report data!');
|
|
|
|
$('#balanceReport').removeClass('loading').addClass('general-chart-error');
|
|
|
|
}
|
|
|
|
|
2016-10-26 16:46:43 +02:00
|
|
|
function failCategoryReport() {
|
|
|
|
"use strict";
|
|
|
|
console.log('Fail category report data!');
|
|
|
|
$('#categoryReport').removeClass('loading').addClass('general-chart-error');
|
|
|
|
}
|
|
|
|
|
2015-03-04 20:47:00 +01:00
|
|
|
|
2015-05-08 17:13:49 +02:00
|
|
|
function drawChart() {
|
2015-05-24 20:41:14 +02:00
|
|
|
"use strict";
|
2015-12-12 19:04:30 +01:00
|
|
|
|
2015-12-14 20:37:38 +01:00
|
|
|
// month view:
|
|
|
|
// draw account chart
|
2016-03-16 17:28:04 +01:00
|
|
|
lineChart('chart/account/report/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'account-balances-chart');
|
2015-12-03 14:52:10 +01:00
|
|
|
}
|