Revamp multi-account report.

This commit is contained in:
James Cole
2019-09-03 22:35:41 +02:00
parent 4743230136
commit 47de2fec28
29 changed files with 2286 additions and 628 deletions

View File

@@ -1,32 +0,0 @@
/*
* month.js
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: spentUri, categoryUri, budgetUri, expenseUri, incomeUri, mainUri */
$(function () {
"use strict";
doubleYChart(mainUri, 'in-out-chart');
loadAjaxPartial('inOutAccounts', spentUri);
loadAjaxPartial('inOutCategory', categoryUri);
loadAjaxPartial('inOutBudget', budgetUri);
loadAjaxPartial('topXexpense', expenseUri);
loadAjaxPartial('topXincome', incomeUri);
});

43
public/v1/js/ff/reports/double/month.js vendored Normal file
View File

@@ -0,0 +1,43 @@
/*
* month.js
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
$(function () {
"use strict";
loadAjaxPartial('opsAccounts', opsAccountsUri);
loadAjaxPartial('opsAccountsAsset', opsAccountsAssetUri);
multiCurrencyPieChart(categoryOutUri, 'category-out-pie-chart');
multiCurrencyPieChart(categoryInUri, 'category-in-pie-chart');
multiCurrencyPieChart(budgetsOutUri, 'budgets-out-pie-chart');
multiCurrencyPieChart(tagOutUri, 'tag-out-pie-chart');
multiCurrencyPieChart(tagInUri, 'tag-in-pie-chart');
$.each($('.main_double_canvas'), function (i, v) {
var canvas = $(v);
columnChart(canvas.data('url'), canvas.attr('id'));
});
loadAjaxPartial('topExpensesHolder', topExpensesUri);
loadAjaxPartial('avgExpensesHolder', avgExpensesUri);
loadAjaxPartial('topIncomeHolder', topIncomeUri);
loadAjaxPartial('avgIncomeHolder', avgIncomeUri);
});

View File

@@ -132,13 +132,13 @@ function setOptionalFromCookies() {
$('#inputTags').multiselect(defaultMultiSelect);
// and expense/revenue thing
if ((readCookie('report-exp-rev') !== null)) {
arr = readCookie('report-exp-rev').split(',');
if ((readCookie('report-double') !== null)) {
arr = readCookie('report-double').split(',');
arr.forEach(function (val) {
$('#inputExpRevAccounts').find('option[value="' + encodeURI(val) + '"]').prop('selected', true);
$('#inputDoubleAccounts').find('option[value="' + encodeURI(val) + '"]').prop('selected', true);
});
}
$('#inputExpRevAccounts').multiselect(defaultMultiSelect);
$('#inputDoubleAccounts').multiselect(defaultMultiSelect);
}
@@ -153,7 +153,7 @@ function catchSubmit() {
var categories = $('#inputCategories').val();
var budgets = $('#inputBudgets').val();
var tags = $('#inputTags').val();
var expRev = $('#inputExpRevAccounts').val();
var double = $('#inputDoubleAccounts').val();
// remember all
// set cookie to remember choices.
@@ -162,7 +162,7 @@ function catchSubmit() {
createCookie('report-categories', categories, 365);
createCookie('report-budgets', budgets, 365);
createCookie('report-tags', tags, 365);
createCookie('report-exp-rev', expRev, 365);
createCookie('report-double', double, 365);
createCookie('report-start', moment(picker.startDate).format("YYYYMMDD"), 365);
createCookie('report-end', moment(picker.endDate).format("YYYYMMDD"), 365);