mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 06:43:23 +00:00
Move some stuff over to AJAX thing.
This commit is contained in:
@@ -173,7 +173,10 @@ class ReportController extends Controller
|
|||||||
/** @var CategoryRepositoryInterface $repository */
|
/** @var CategoryRepositoryInterface $repository */
|
||||||
$repository = app(CategoryRepositoryInterface::class);
|
$repository = app(CategoryRepositoryInterface::class);
|
||||||
$category = $repository->find(intval($attributes['categoryId']));
|
$category = $repository->find(intval($attributes['categoryId']));
|
||||||
$journals = $repository->journalsInPeriod(new Collection([$category]), $attributes['accounts'], [], $attributes['startDate'], $attributes['endDate']);
|
$types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
|
||||||
|
$journals = $repository->journalsInPeriod(
|
||||||
|
new Collection([$category]), $attributes['accounts'], $types, $attributes['startDate'], $attributes['endDate']
|
||||||
|
);
|
||||||
$view = view('popup.report.category-entry', compact('journals', 'category'))->render();
|
$view = view('popup.report.category-entry', compact('journals', 'category'))->render();
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
|
49
app/Http/Controllers/Report/InOutController.php
Normal file
49
app/Http/Controllers/Report/InOutController.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* InOutController.php
|
||||||
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||||
|
*
|
||||||
|
* This software may be modified and distributed under the terms of the
|
||||||
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||||
|
*
|
||||||
|
* See the LICENSE file for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
namespace FireflyIII\Http\Controllers\Report;
|
||||||
|
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use FireflyIII\Helpers\Report\ReportHelperInterface;
|
||||||
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class InOutController
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Http\Controllers\Report
|
||||||
|
*/
|
||||||
|
class InOutController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public function inOutReport(ReportHelperInterface $helper, Carbon $start, Carbon $end, Collection $accounts)
|
||||||
|
{
|
||||||
|
|
||||||
|
$incomes = $helper->getIncomeReport($start, $end, $accounts);
|
||||||
|
$expenses = $helper->getExpenseReport($start, $end, $accounts);
|
||||||
|
$incomeTopLength = 8;
|
||||||
|
$expenseTopLength = 8;
|
||||||
|
|
||||||
|
return Response::json(
|
||||||
|
[
|
||||||
|
'income' => view('reports.partials.income', compact('incomes', 'incomeTopLength'))->render(),
|
||||||
|
'expenses' => view('reports.partials.expenses', compact('expenses', 'expenseTopLength'))->render(),
|
||||||
|
'incomes_expenses' => view('reports.partials.income-vs-expenses', compact('expenses', 'incomes'))->render(),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -22,7 +22,6 @@ use FireflyIII\Models\Account;
|
|||||||
use FireflyIII\Models\AccountType;
|
use FireflyIII\Models\AccountType;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
|
|
||||||
use FireflyIII\Repositories\Account\AccountTaskerInterface;
|
use FireflyIII\Repositories\Account\AccountTaskerInterface;
|
||||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||||
@@ -226,12 +225,7 @@ class ReportController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function defaultMonth(string $reportType, Carbon $start, Carbon $end, Collection $accounts)
|
private function defaultMonth(string $reportType, Carbon $start, Carbon $end, Collection $accounts)
|
||||||
{
|
{
|
||||||
$incomeTopLength = 8;
|
|
||||||
$expenseTopLength = 8;
|
|
||||||
|
|
||||||
// get report stuff!
|
// get report stuff!
|
||||||
$incomes = $this->helper->getIncomeReport($start, $end, $accounts);
|
|
||||||
$expenses = $this->helper->getExpenseReport($start, $end, $accounts);
|
|
||||||
$budgets = $this->budgetHelper->getBudgetReport($start, $end, $accounts);
|
$budgets = $this->budgetHelper->getBudgetReport($start, $end, $accounts);
|
||||||
$categories = $this->helper->getCategoryReport($start, $end, $accounts);
|
$categories = $this->helper->getCategoryReport($start, $end, $accounts);
|
||||||
$balance = $this->balanceHelper->getBalanceReport($start, $end, $accounts);
|
$balance = $this->balanceHelper->getBalanceReport($start, $end, $accounts);
|
||||||
@@ -247,8 +241,7 @@ class ReportController extends Controller
|
|||||||
compact(
|
compact(
|
||||||
'start', 'end', 'reportType',
|
'start', 'end', 'reportType',
|
||||||
'tags',
|
'tags',
|
||||||
'incomes', 'incomeTopLength',
|
'incomes',
|
||||||
'expenses', 'expenseTopLength',
|
|
||||||
'budgets', 'balance',
|
'budgets', 'balance',
|
||||||
'categories',
|
'categories',
|
||||||
'bills',
|
'bills',
|
||||||
@@ -268,13 +261,8 @@ class ReportController extends Controller
|
|||||||
private function defaultMultiYear(string $reportType, Carbon $start, Carbon $end, Collection $accounts)
|
private function defaultMultiYear(string $reportType, Carbon $start, Carbon $end, Collection $accounts)
|
||||||
{
|
{
|
||||||
|
|
||||||
$incomeTopLength = 8;
|
|
||||||
$expenseTopLength = 8;
|
|
||||||
// list of users stuff:
|
|
||||||
$budgets = app(BudgetRepositoryInterface::class)->getActiveBudgets();
|
$budgets = app(BudgetRepositoryInterface::class)->getActiveBudgets();
|
||||||
$categories = app(CategoryRepositoryInterface::class)->getCategories();
|
$categories = app(CategoryRepositoryInterface::class)->getCategories();
|
||||||
$incomes = $this->helper->getIncomeReport($start, $end, $accounts);
|
|
||||||
$expenses = $this->helper->getExpenseReport($start, $end, $accounts);
|
|
||||||
$tags = $this->helper->tagReport($start, $end, $accounts);
|
$tags = $this->helper->tagReport($start, $end, $accounts);
|
||||||
|
|
||||||
// and some id's, joined:
|
// and some id's, joined:
|
||||||
@@ -288,9 +276,7 @@ class ReportController extends Controller
|
|||||||
return view(
|
return view(
|
||||||
'reports.default.multi-year',
|
'reports.default.multi-year',
|
||||||
compact(
|
compact(
|
||||||
'budgets', 'accounts', 'categories', 'start', 'end', 'accountIds', 'reportType',
|
'budgets', 'accounts', 'categories', 'start', 'end', 'accountIds', 'reportType', 'tags'
|
||||||
'incomes', 'expenses',
|
|
||||||
'incomeTopLength', 'expenseTopLength', 'tags'
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -305,11 +291,6 @@ class ReportController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function defaultYear(string $reportType, Carbon $start, Carbon $end, Collection $accounts)
|
private function defaultYear(string $reportType, Carbon $start, Carbon $end, Collection $accounts)
|
||||||
{
|
{
|
||||||
$incomeTopLength = 8;
|
|
||||||
$expenseTopLength = 8;
|
|
||||||
|
|
||||||
$incomes = $this->helper->getIncomeReport($start, $end, $accounts);
|
|
||||||
$expenses = $this->helper->getExpenseReport($start, $end, $accounts);
|
|
||||||
$tags = $this->helper->tagReport($start, $end, $accounts);
|
$tags = $this->helper->tagReport($start, $end, $accounts);
|
||||||
$budgets = $this->budgetHelper->budgetYearOverview($start, $end, $accounts);
|
$budgets = $this->budgetHelper->budgetYearOverview($start, $end, $accounts);
|
||||||
|
|
||||||
@@ -328,8 +309,7 @@ class ReportController extends Controller
|
|||||||
return view(
|
return view(
|
||||||
'reports.default.year',
|
'reports.default.year',
|
||||||
compact(
|
compact(
|
||||||
'start', 'incomes', 'reportType', 'accountIds', 'end',
|
'start', 'reportType', 'accountIds', 'end', 'tags', 'budgets'
|
||||||
'expenses', 'incomeTopLength', 'expenseTopLength', 'tags', 'budgets'
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -75,12 +75,24 @@ class Range
|
|||||||
|
|
||||||
// set view variables.
|
// set view variables.
|
||||||
$this->configureView();
|
$this->configureView();
|
||||||
|
|
||||||
|
// set more view variables:
|
||||||
|
$this->configureList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $theNext($request);
|
return $theNext($request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private function configureList()
|
||||||
|
{
|
||||||
|
$pref = Preferences::get('list-length', config('firefly.list_length', 10))->data;
|
||||||
|
View::share('listLength', $pref);
|
||||||
|
}
|
||||||
|
|
||||||
private function configureView()
|
private function configureView()
|
||||||
{
|
{
|
||||||
$pref = Preferences::get('language', config('firefly.default_language', 'en_US'));
|
$pref = Preferences::get('language', config('firefly.default_language', 'en_US'));
|
||||||
|
@@ -241,6 +241,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
if (count($types) > 0) {
|
if (count($types) > 0) {
|
||||||
$query->transactionTypes($types);
|
$query->transactionTypes($types);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($accounts->count() > 0) {
|
if ($accounts->count() > 0) {
|
||||||
$accountIds = $accounts->pluck('id')->toArray();
|
$accountIds = $accounts->pluck('id')->toArray();
|
||||||
$query->leftJoin('transactions as t', 't.transaction_journal_id', '=', 'transaction_journals.id');
|
$query->leftJoin('transactions as t', 't.transaction_journal_id', '=', 'transaction_journals.id');
|
||||||
@@ -275,7 +276,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$second = $query->get(['transaction_journals.*']);
|
$second = $query->get(['transaction_journals.*','transaction_types.type as transaction_type_type']);
|
||||||
|
|
||||||
$complete = $complete->merge($first);
|
$complete = $complete->merge($first);
|
||||||
$complete = $complete->merge($second);
|
$complete = $complete->merge($second);
|
||||||
|
@@ -28,6 +28,7 @@ return [
|
|||||||
'allowedMimes' => ['image/png', 'image/jpeg', 'application/pdf'],
|
'allowedMimes' => ['image/png', 'image/jpeg', 'application/pdf'],
|
||||||
'resend_confirmation' => 3600,
|
'resend_confirmation' => 3600,
|
||||||
'confirmation_age' => 14400, // four hours
|
'confirmation_age' => 14400, // four hours
|
||||||
|
'list_length' => 10,
|
||||||
|
|
||||||
'export_formats' => [
|
'export_formats' => [
|
||||||
'csv' => 'FireflyIII\Export\Exporter\CsvExporter',
|
'csv' => 'FireflyIII\Export\Exporter\CsvExporter',
|
||||||
|
@@ -8,11 +8,6 @@
|
|||||||
|
|
||||||
/* globals hideable */
|
/* globals hideable */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by sander on 01/04/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* globals startDate, endDate, reportType, accountIds */
|
/* globals startDate, showOnlyTop, showFullList, endDate, reportType, accountIds, inOutReportUrl, accountReportUrl */
|
||||||
/*
|
/*
|
||||||
* all.js
|
* all.js
|
||||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||||
@@ -7,10 +7,6 @@
|
|||||||
* of the MIT license. See the LICENSE file for details.
|
* of the MIT license. See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by sander on 01/04/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -20,8 +16,62 @@ $(function () {
|
|||||||
// load the account report, which this report shows:
|
// load the account report, which this report shows:
|
||||||
loadAccountReport();
|
loadAccountReport();
|
||||||
|
|
||||||
|
// load income / expense / difference:
|
||||||
|
loadInOutReport();
|
||||||
|
|
||||||
|
// trigger list length things:
|
||||||
|
listLengthInitial();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function listLengthInitial() {
|
||||||
|
"use strict";
|
||||||
|
$('.overListLength').hide();
|
||||||
|
$('.listLengthTrigger').unbind('click').click(triggerList)
|
||||||
|
}
|
||||||
|
|
||||||
|
function triggerList(e) {
|
||||||
|
"use strict";
|
||||||
|
var link = $(e.target);
|
||||||
|
var table = link.parent().parent().parent().parent();
|
||||||
|
console.log('data-hidden = ' + table.attr('data-hidden'));
|
||||||
|
if (table.attr('data-hidden') === 'no') {
|
||||||
|
// hide all elements, return false.
|
||||||
|
table.find('.overListLength').hide();
|
||||||
|
table.attr('data-hidden', 'yes');
|
||||||
|
link.text(showFullList);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// show all, return false
|
||||||
|
table.find('.overListLength').show();
|
||||||
|
table.attr('data-hidden', 'no');
|
||||||
|
link.text(showOnlyTop);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadInOutReport() {
|
||||||
|
"use strict";
|
||||||
|
console.log('Going to grab ' + inOutReportUrl);
|
||||||
|
$.get(inOutReportUrl).done(placeInOutReport).fail(failInOutReport);
|
||||||
|
}
|
||||||
|
|
||||||
|
function placeInOutReport(data) {
|
||||||
|
"use strict";
|
||||||
|
$('#incomeReport').removeClass('loading').html(data.income);
|
||||||
|
$('#expenseReport').removeClass('loading').html(data.expenses);
|
||||||
|
$('#incomeVsExpenseReport').removeClass('loading').html(data.incomes_expenses);
|
||||||
|
listLengthInitial();
|
||||||
|
}
|
||||||
|
|
||||||
|
function failInOutReport() {
|
||||||
|
"use strict";
|
||||||
|
console.log('Fail in/out report data!');
|
||||||
|
$('#incomeReport').removeClass('loading').addClass('general-chart-error');
|
||||||
|
$('#expenseReport').removeClass('loading').addClass('general-chart-error');
|
||||||
|
$('#incomeVsExpenseReport').removeClass('loading').addClass('general-chart-error');
|
||||||
|
}
|
||||||
|
|
||||||
function loadAccountReport() {
|
function loadAccountReport() {
|
||||||
"use strict";
|
"use strict";
|
||||||
$.get(accountReportUrl).done(placeAccountReport).fail(failAccountReport);
|
$.get(accountReportUrl).done(placeAccountReport).fail(failAccountReport);
|
||||||
|
@@ -1,14 +1,9 @@
|
|||||||
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, expenseRestShow:true, incomeRestShow:true, year, month, hideTheRest, showTheRest, showTheRestExpense, hideTheRestExpense, columnChart, lineChart, stackedColumnChart */
|
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, year, month, columnChart, lineChart, stackedColumnChart */
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
drawChart();
|
drawChart();
|
||||||
|
|
||||||
// click open the top X income list:
|
|
||||||
$('#showIncomes').click(showIncomes);
|
|
||||||
// click open the top X expense list:
|
|
||||||
$('#showExpenses').click(showExpenses);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -19,46 +14,3 @@ function drawChart() {
|
|||||||
// draw account chart
|
// draw account chart
|
||||||
lineChart('chart/account/report/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'account-balances-chart');
|
lineChart('chart/account/report/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'account-balances-chart');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function showIncomes() {
|
|
||||||
"use strict";
|
|
||||||
if (incomeRestShow) {
|
|
||||||
// hide everything, make button say "show"
|
|
||||||
$('#showIncomes').text(showTheRest);
|
|
||||||
$('.incomesCollapsed').removeClass('in').addClass('out');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
incomeRestShow = false;
|
|
||||||
} else {
|
|
||||||
// show everything, make button say "hide".
|
|
||||||
$('#showIncomes').text(hideTheRest);
|
|
||||||
$('.incomesCollapsed').removeClass('out').addClass('in');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
incomeRestShow = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showExpenses() {
|
|
||||||
"use strict";
|
|
||||||
if (expenseRestShow) {
|
|
||||||
// hide everything, make button say "show"
|
|
||||||
$('#showExpenses').text(showTheRestExpense);
|
|
||||||
$('.expenseCollapsed').removeClass('in').addClass('out');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
expenseRestShow = false;
|
|
||||||
} else {
|
|
||||||
// show everything, make button say "hide".
|
|
||||||
$('#showExpenses').text(hideTheRestExpense);
|
|
||||||
$('.expenseCollapsed').removeClass('out').addClass('in');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
expenseRestShow = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
@@ -1,15 +1,10 @@
|
|||||||
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, expenseRestShow:true, incomeRestShow:true, year, month, hideTheRest, showTheRest, showTheRestExpense, hideTheRestExpense, columnChart, lineChart, stackedColumnChart */
|
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, year, month, columnChart, lineChart, stackedColumnChart */
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
drawChart();
|
drawChart();
|
||||||
|
|
||||||
// click open the top X income list:
|
|
||||||
$('#showIncomes').click(showIncomes);
|
|
||||||
// click open the top X expense list:
|
|
||||||
$('#showExpenses').click(showExpenses);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -159,47 +154,3 @@ function readCookie(name) {
|
|||||||
function eraseCookie(name) {
|
function eraseCookie(name) {
|
||||||
createCookie(name, "", -1);
|
createCookie(name, "", -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function showIncomes() {
|
|
||||||
"use strict";
|
|
||||||
if (incomeRestShow) {
|
|
||||||
// hide everything, make button say "show"
|
|
||||||
$('#showIncomes').text(showTheRest);
|
|
||||||
$('.incomesCollapsed').removeClass('in').addClass('out');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
incomeRestShow = false;
|
|
||||||
} else {
|
|
||||||
// show everything, make button say "hide".
|
|
||||||
$('#showIncomes').text(hideTheRest);
|
|
||||||
$('.incomesCollapsed').removeClass('out').addClass('in');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
incomeRestShow = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showExpenses() {
|
|
||||||
"use strict";
|
|
||||||
if (expenseRestShow) {
|
|
||||||
// hide everything, make button say "show"
|
|
||||||
$('#showExpenses').text(showTheRestExpense);
|
|
||||||
$('.expenseCollapsed').removeClass('in').addClass('out');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
expenseRestShow = false;
|
|
||||||
} else {
|
|
||||||
// show everything, make button say "hide".
|
|
||||||
$('#showExpenses').text(hideTheRestExpense);
|
|
||||||
$('.expenseCollapsed').removeClass('out').addClass('in');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
expenseRestShow = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
@@ -1,4 +1,4 @@
|
|||||||
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, expenseRestShow:true, incomeRestShow:true, year, month, hideTheRest, showTheRest, showTheRestExpense, hideTheRestExpense, columnChart, lineChart, stackedColumnChart */
|
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, year, month, columnChart, lineChart, stackedColumnChart */
|
||||||
|
|
||||||
var chartDrawn;
|
var chartDrawn;
|
||||||
var budgetChart;
|
var budgetChart;
|
||||||
@@ -7,10 +7,6 @@ $(function () {
|
|||||||
chartDrawn = false;
|
chartDrawn = false;
|
||||||
drawChart();
|
drawChart();
|
||||||
|
|
||||||
// click open the top X income list:
|
|
||||||
$('#showIncomes').click(showIncomes);
|
|
||||||
// click open the top X expense list:
|
|
||||||
$('#showExpenses').click(showExpenses);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -86,52 +82,5 @@ function clickBudgetChart(e) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if chart drawn is true, add new data to existing chart.
|
|
||||||
// console.log('Budget id is ' + budgetId);
|
|
||||||
// $('#budget_chart').empty();
|
|
||||||
// columnChart('chart/budget/period/' + budgetId + '/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'budget_chart');
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showIncomes() {
|
|
||||||
"use strict";
|
|
||||||
if (incomeRestShow) {
|
|
||||||
// hide everything, make button say "show"
|
|
||||||
$('#showIncomes').text(showTheRest);
|
|
||||||
$('.incomesCollapsed').removeClass('in').addClass('out');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
incomeRestShow = false;
|
|
||||||
} else {
|
|
||||||
// show everything, make button say "hide".
|
|
||||||
$('#showIncomes').text(hideTheRest);
|
|
||||||
$('.incomesCollapsed').removeClass('out').addClass('in');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
incomeRestShow = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showExpenses() {
|
|
||||||
"use strict";
|
|
||||||
if (expenseRestShow) {
|
|
||||||
// hide everything, make button say "show"
|
|
||||||
$('#showExpenses').text(showTheRestExpense);
|
|
||||||
$('.expenseCollapsed').removeClass('in').addClass('out');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
expenseRestShow = false;
|
|
||||||
} else {
|
|
||||||
// show everything, make button say "hide".
|
|
||||||
$('#showExpenses').text(hideTheRestExpense);
|
|
||||||
$('.expenseCollapsed').removeClass('out').addClass('in');
|
|
||||||
|
|
||||||
// toggle:
|
|
||||||
expenseRestShow = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, expenseRestShow:true, incomeRestShow:true, year, month, hideTheRest, showTheRest, showTheRestExpense, hideTheRestExpense, columnChart, lineChart, stackedColumnChart */
|
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, year, month, columnChart, lineChart, stackedColumnChart */
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
@@ -604,8 +604,8 @@ return [
|
|||||||
'in' => 'In',
|
'in' => 'In',
|
||||||
'out' => 'Out',
|
'out' => 'Out',
|
||||||
'topX' => 'top :number',
|
'topX' => 'top :number',
|
||||||
'showTheRest' => 'Show everything',
|
'show_full_list' => 'Show entire list',
|
||||||
'hideTheRest' => 'Show only the top :number',
|
'show_only_top' => 'Show only top :number',
|
||||||
'sum_of_year' => 'Sum of year',
|
'sum_of_year' => 'Sum of year',
|
||||||
'sum_of_years' => 'Sum of years',
|
'sum_of_years' => 'Sum of years',
|
||||||
'average_of_year' => 'Average of year',
|
'average_of_year' => 'Average of year',
|
||||||
|
@@ -192,6 +192,9 @@
|
|||||||
var mon_thousands_sep = "{{ localeconv.mon_thousands_sep|escape('js') }}";
|
var mon_thousands_sep = "{{ localeconv.mon_thousands_sep|escape('js') }}";
|
||||||
var frac_digits = {{ localeconv.frac_digits }};
|
var frac_digits = {{ localeconv.frac_digits }};
|
||||||
|
|
||||||
|
var showFullList = '{{ trans('firefly.show_full_list') }}';
|
||||||
|
var showOnlyTop = '{{ trans('firefly.show_only_top',{number:listLength}) }}';
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -22,18 +22,13 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="accountReport">
|
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="accountReport">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="incomeReport">
|
||||||
<!-- income -->
|
|
||||||
{% include 'reports/partials/income.twig' %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="expenseReport">
|
||||||
<!-- expenses -->
|
|
||||||
{% include 'reports/partials/expenses.twig' %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="incomeVsExpenseReport">
|
||||||
{% include 'reports/partials/income-vs-expenses.twig' %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
{% include 'reports/partials/tags.twig' %}
|
{% include 'reports/partials/tags.twig' %}
|
||||||
@@ -84,17 +79,9 @@
|
|||||||
var reportType = '{{ reportType }}';
|
var reportType = '{{ reportType }}';
|
||||||
var accountIds = '{{ accountIds }}';
|
var accountIds = '{{ accountIds }}';
|
||||||
|
|
||||||
var incomeTopLength = {{ incomeTopLength }};
|
|
||||||
var expenseTopLength = {{ expenseTopLength }};
|
|
||||||
var incomeRestShow = false; // starts hidden.
|
|
||||||
var expenseRestShow = false; // starts hidden.
|
|
||||||
var showTheRest = '{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}';
|
|
||||||
var hideTheRest = '{{ trans('firefly.hideTheRest',{number:incomeTopLength}) }}';
|
|
||||||
var showTheRestExpense = '{{ trans('firefly.showTheRest',{number:expenseTopLength}) }}';
|
|
||||||
var hideTheRestExpense = '{{ trans('firefly.hideTheRest',{number:expenseTopLength}) }}';
|
|
||||||
|
|
||||||
<!-- some URL's -->
|
<!-- some URL's -->
|
||||||
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
|
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
|
||||||
|
var inOutReportUrl = '{{ route('reports.data.inOutReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>
|
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>
|
||||||
<script type="text/javascript" src="js/ff/reports/default/month.js"></script>
|
<script type="text/javascript" src="js/ff/reports/default/month.js"></script>
|
||||||
|
@@ -33,18 +33,13 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="accountReport">
|
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="accountReport">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="incomeReport">
|
||||||
<!-- income -->
|
|
||||||
{% include 'reports/partials/income.twig' %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="expenseReport">
|
||||||
<!-- expenses -->
|
|
||||||
{% include 'reports/partials/expenses.twig' %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="incomeVsExpenseReport">
|
||||||
{% include 'reports/partials/income-vs-expenses.twig' %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
{% include 'reports/partials/tags.twig' %}
|
{% include 'reports/partials/tags.twig' %}
|
||||||
@@ -165,17 +160,9 @@
|
|||||||
var reportType = '{{ reportType }}';
|
var reportType = '{{ reportType }}';
|
||||||
var accountIds = '{{ accountIds }}';
|
var accountIds = '{{ accountIds }}';
|
||||||
|
|
||||||
var incomeTopLength = {{ incomeTopLength }};
|
|
||||||
var expenseTopLength = {{ expenseTopLength }};
|
|
||||||
var incomeRestShow = false; // starts hidden.
|
|
||||||
var expenseRestShow = false; // starts hidden.
|
|
||||||
var showTheRest = '{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}';
|
|
||||||
var hideTheRest = '{{ trans('firefly.hideTheRest',{number:incomeTopLength}) }}';
|
|
||||||
var showTheRestExpense = '{{ trans('firefly.showTheRest',{number:expenseTopLength}) }}';
|
|
||||||
var hideTheRestExpense = '{{ trans('firefly.hideTheRest',{number:expenseTopLength}) }}';
|
|
||||||
|
|
||||||
<!-- some URL's -->
|
<!-- some URL's -->
|
||||||
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
|
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
|
||||||
|
var inOutReportUrl = '{{ route('reports.data.inOutReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>
|
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>
|
||||||
|
@@ -33,14 +33,12 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
<div class="loading" id="accountReport">
|
<div class="loading" id="accountReport">
|
||||||
</div>
|
</div>
|
||||||
{% include 'reports/partials/income-vs-expenses.twig' %}
|
<div class="loading" id="incomeVsExpenseReport">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
|
||||||
{% include 'reports/partials/income.twig' %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="incomeReport">
|
||||||
{% include 'reports/partials/expenses.twig' %}
|
</div>
|
||||||
|
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="expenseReport">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -125,18 +123,9 @@
|
|||||||
var reportType = '{{ reportType }}';
|
var reportType = '{{ reportType }}';
|
||||||
var accountIds = '{{ accountIds }}';
|
var accountIds = '{{ accountIds }}';
|
||||||
|
|
||||||
|
|
||||||
var incomeTopLength = {{ incomeTopLength }};
|
|
||||||
var expenseTopLength = {{ expenseTopLength }};
|
|
||||||
var incomeRestShow = false; // starts hidden.
|
|
||||||
var expenseRestShow = false; // starts hidden.
|
|
||||||
var showTheRest = '{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}';
|
|
||||||
var hideTheRest = '{{ trans('firefly.hideTheRest',{number:incomeTopLength}) }}';
|
|
||||||
var showTheRestExpense = '{{ trans('firefly.showTheRest',{number:expenseTopLength}) }}';
|
|
||||||
var hideTheRestExpense = '{{ trans('firefly.hideTheRest',{number:expenseTopLength}) }}';
|
|
||||||
|
|
||||||
<!-- some URL's -->
|
<!-- some URL's -->
|
||||||
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
|
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
|
||||||
|
var inOutReportUrl = '{{ route('reports.data.inOutReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>
|
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for expense in expenses.getExpenses %}
|
{% for expense in expenses.getExpenses %}
|
||||||
{% if loop.index > expenseTopLength %}
|
{% if loop.index > listLength %}
|
||||||
<tr class="collapse out expenseCollapsed">
|
<tr class="overListLength">
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
{% if expenses.getExpenses|length > expenseTopLength %}
|
{% if expenses.getExpenses|length > expenseTopLength %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="active">
|
<td colspan="2" class="active">
|
||||||
<a href="#" id="showExpenses">{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}</a>
|
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for income in incomes.getIncomes %}
|
{% for income in incomes.getIncomes %}
|
||||||
{% if loop.index > incomeTopLength %}
|
{% if loop.index > listLength %}
|
||||||
<tr class="collapse out incomesCollapsed">
|
<tr class="overListLength">
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -23,15 +23,16 @@
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>{{ income.amount|formatAmount }}</td>
|
<td>{{ income.amount|formatAmount }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
{% if incomes.getIncomes|length > incomeTopLength %}
|
{% if incomes.getIncomes|length > listLength %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="active">
|
<td colspan="2" class="active">
|
||||||
<a href="#" id="showIncomes">{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}</a>
|
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{ number:listLength } ) }}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -317,11 +317,18 @@ Route::group(
|
|||||||
/**
|
/**
|
||||||
* Report AJAX data Controller:
|
* Report AJAX data Controller:
|
||||||
*/
|
*/
|
||||||
|
// account report
|
||||||
Route::get(
|
Route::get(
|
||||||
'/reports/data/accountReport/{start_date}/{end_date}/{accountList}',
|
'/reports/data/account-report/{start_date}/{end_date}/{accountList}',
|
||||||
['uses' => 'Report\AccountController@accountReport', 'as' => 'reports.data.accountReport']
|
['uses' => 'Report\AccountController@accountReport', 'as' => 'reports.data.accountReport']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// income report
|
||||||
|
Route::get(
|
||||||
|
'/reports/data/in-out-report/{start_date}/{end_date}/{accountList}',
|
||||||
|
['uses' => 'Report\InOutController@inOutReport', 'as' => 'reports.data.inOutReport']
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rules Controller
|
* Rules Controller
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user