Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Move some stuff over to AJAX thing.
James Colea7e5fcc806f4
diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.phpindex c6893a6014..0b4df645ba 100644--- a/app/Http/Controllers/Popup/ReportController.php+++ b/app/Http/Controllers/Popup/ReportController.php@@ -173,7 +173,10 @@ class ReportController extends Controller/** @var CategoryRepositoryInterface $repository */$repository = app(CategoryRepositoryInterface::class);$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();return $view;diff --git a/app/Http/Controllers/Report/InOutController.php b/app/Http/Controllers/Report/InOutController.phpnew file mode 100644index 0000000000..7272597820--- /dev/null+++ b/app/Http/Controllers/Report/InOutController.php@@ -0,0 +1,49 @@+<?php+/**+ * InOutController.php+ * Copyright (C) 2016 [email protected]+ *+ * 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(),+ ]+ );+ }++}\ No newline at end of filediff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.phpindex ee09d7e9cd..7a208eafbb 100644--- a/app/Http/Controllers/ReportController.php+++ b/app/Http/Controllers/ReportController.php@@ -22,7 +22,6 @@ use FireflyIII\Models\Account;use FireflyIII\Models\AccountType;use FireflyIII\Models\Transaction;use FireflyIII\Repositories\Account\AccountRepositoryInterface;-use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;use FireflyIII\Repositories\Account\AccountTaskerInterface;use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;use FireflyIII\Repositories\Category\CategoryRepositoryInterface;@@ -226,12 +225,7 @@ class ReportController extends Controller*/private function defaultMonth(string $reportType, Carbon $start, Carbon $end, Collection $accounts){- $incomeTopLength = 8;- $expenseTopLength = 8;-// get report stuff!- $incomes = $this->helper->getIncomeReport($start, $end, $accounts);- $expenses = $this->helper->getExpenseReport($start, $end, $accounts);$budgets = $this->budgetHelper->getBudgetReport($start, $end, $accounts);$categories = $this->helper->getCategoryReport($start, $end, $accounts);$balance = $this->balanceHelper->getBalanceReport($start, $end, $accounts);@@ -247,8 +241,7 @@ class ReportController extends Controllercompact('start', 'end', 'reportType','tags',- 'incomes', 'incomeTopLength',- 'expenses', 'expenseTopLength',+ 'incomes','budgets', 'balance','categories','bills',@@ -268,13 +261,8 @@ class ReportController extends Controllerprivate function defaultMultiYear(string $reportType, Carbon $start, Carbon $end, Collection $accounts){- $incomeTopLength = 8;- $expenseTopLength = 8;- // list of users stuff:$budgets = app(BudgetRepositoryInterface::class)->getActiveBudgets();$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);// and some id's, joined:@@ -288,9 +276,7 @@ class ReportController extends Controllerreturn view('reports.default.multi-year',compact(- 'budgets', 'accounts', 'categories', 'start', 'end', 'accountIds', 'reportType',- 'incomes', 'expenses',- 'incomeTopLength', 'expenseTopLength', 'tags'+ 'budgets', 'accounts', 'categories', 'start', 'end', 'accountIds', 'reportType', 'tags'));}@@ -305,11 +291,6 @@ class ReportController extends Controller*/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);$budgets = $this->budgetHelper->budgetYearOverview($start, $end, $accounts);@@ -328,8 +309,7 @@ class ReportController extends Controllerreturn view('reports.default.year',compact(- 'start', 'incomes', 'reportType', 'accountIds', 'end',- 'expenses', 'incomeTopLength', 'expenseTopLength', 'tags', 'budgets'+ 'start', 'reportType', 'accountIds', 'end', 'tags', 'budgets'));}diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.phpindex f64f5939e0..c483088515 100644--- a/app/Http/Middleware/Range.php+++ b/app/Http/Middleware/Range.php@@ -75,12 +75,24 @@ class Range// set view variables.$this->configureView();++ // set more view variables:+ $this->configureList();}return $theNext($request);}+ /**+ *+ */+ private function configureList()+ {+ $pref = Preferences::get('list-length', config('firefly.list_length', 10))->data;+ View::share('listLength', $pref);+ }+private function configureView(){$pref = Preferences::get('language', config('firefly.default_language', 'en_US'));diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.phpindex 9a47d6cc8b..6880813805 100644--- a/app/Repositories/Category/CategoryRepository.php+++ b/app/Repositories/Category/CategoryRepository.php@@ -241,6 +241,7 @@ class CategoryRepository implements CategoryRepositoryInterfaceif (count($types) > 0) {$query->transactionTypes($types);}+if ($accounts->count() > 0) {$accountIds = $accounts->pluck('id')->toArray();$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($second);diff --git a/config/firefly.php b/config/firefly.phpindex 9f540ab239..be4ee78bfd 100644--- a/config/firefly.php+++ b/config/firefly.php@@ -28,6 +28,7 @@ return ['allowedMimes' => ['image/png', 'image/jpeg', 'application/pdf'],'resend_confirmation' => 3600,'confirmation_age' => 14400, // four hours+ 'list_length' => 10,'export_formats' => ['csv' => 'FireflyIII\Export\Exporter\CsvExporter',diff --git a/public/js/ff/reports/audit/all.js b/public/js/ff/reports/audit/all.jsindex c57875937c..f9f5a79f41 100644--- a/public/js/ff/reports/audit/all.js+++ b/public/js/ff/reports/audit/all.js@@ -8,11 +8,6 @@/* globals hideable */--/**- * Created by sander on 01/04/16.- */-$(function () {"use strict";diff --git a/public/js/ff/reports/default/all.js b/public/js/ff/reports/default/all.jsindex e92203fee9..d3a916c725 100644--- a/public/js/ff/reports/default/all.js+++ b/public/js/ff/reports/default/all.js@@ -1,4 +1,4 @@-/* globals startDate, endDate, reportType, accountIds */+/* globals startDate, showOnlyTop, showFullList, endDate, reportType, accountIds, inOutReportUrl, accountReportUrl *//** all.js* Copyright (C) 2016 [email protected]@@ -7,10 +7,6 @@* of the MIT license. See the LICENSE file for details.*/-/**- * Created by sander on 01/04/16.- */-$(function () {"use strict";@@ -20,8 +16,62 @@ $(function () {// load the account report, which this report shows: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() {"use strict";$.get(accountReportUrl).done(placeAccountReport).fail(failAccountReport);diff --git a/public/js/ff/reports/default/month.js b/public/js/ff/reports/default/month.jsindex 22bb92dbc9..e970b554eb 100644--- a/public/js/ff/reports/default/month.js+++ b/public/js/ff/reports/default/month.js@@ -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 () {"use strict";drawChart();-- // click open the top X income list:- $('#showIncomes').click(showIncomes);- // click open the top X expense list:- $('#showExpenses').click(showExpenses);});@@ -18,47 +13,4 @@ function drawChart() {// month view:// draw account chartlineChart('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;}\ No newline at end of filediff --git a/public/js/ff/reports/default/multi-year.js b/public/js/ff/reports/default/multi-year.jsindex 984d0e4a72..78845f5100 100644--- a/public/js/ff/reports/default/multi-year.js+++ b/public/js/ff/reports/default/multi-year.js@@ -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 () {"use strict";drawChart();- // click open the top X income list:- $('#showIncomes').click(showIncomes);- // click open the top X expense list:- $('#showExpenses').click(showExpenses);-});@@ -158,48 +153,4 @@ function readCookie(name) {function eraseCookie(name) {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;}\ No newline at end of filediff --git a/public/js/ff/reports/default/year.js b/public/js/ff/reports/default/year.jsindex 54627fc29d..3afa11d242 100644--- a/public/js/ff/reports/default/year.js+++ b/public/js/ff/reports/default/year.js@@ -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 budgetChart;@@ -7,10 +7,6 @@ $(function () {chartDrawn = false;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;}\ No newline at end of filediff --git a/public/js/ff/reports/index.js b/public/js/ff/reports/index.jsindex 0419062234..8abb613f25 100644--- a/public/js/ff/reports/index.js+++ b/public/js/ff/reports/index.js@@ -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 () {diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.phpindex 5e3cc55a51..186fe8a8ea 100644--- a/resources/lang/en_US/firefly.php+++ b/resources/lang/en_US/firefly.php@@ -604,8 +604,8 @@ return ['in' => 'In','out' => 'Out','topX' => 'top :number',- 'showTheRest' => 'Show everything',- 'hideTheRest' => 'Show only the top :number',+ 'show_full_list' => 'Show entire list',+ 'show_only_top' => 'Show only top :number','sum_of_year' => 'Sum of year','sum_of_years' => 'Sum of years','average_of_year' => 'Average of year',diff --git a/resources/views/layout/default.twig b/resources/views/layout/default.twigindex 960ec20917..376add29e6 100644--- a/resources/views/layout/default.twig+++ b/resources/views/layout/default.twig@@ -192,6 +192,9 @@var mon_thousands_sep = "{{ localeconv.mon_thousands_sep|escape('js') }}";var frac_digits = {{ localeconv.frac_digits }};+ var showFullList = '{{ trans('firefly.show_full_list') }}';+ var showOnlyTop = '{{ trans('firefly.show_only_top',{number:listLength}) }}';+</script>diff --git a/resources/views/reports/default/month.twig b/resources/views/reports/default/month.twigindex 69f1642d41..05f70e7ab5 100644--- a/resources/views/reports/default/month.twig+++ b/resources/views/reports/default/month.twig@@ -22,18 +22,13 @@<div class="row"><div class="col-lg-6 col-md-6 col-sm-6 loading" id="accountReport"></div>- <div class="col-lg-3 col-md-3 col-sm-3">- <!-- income -->- {% include 'reports/partials/income.twig' %}+ <div class="col-lg-3 col-md-3 col-sm-3 loading" id="incomeReport"></div>- <div class="col-lg-3 col-md-3 col-sm-3">- <!-- expenses -->- {% include 'reports/partials/expenses.twig' %}+ <div class="col-lg-3 col-md-3 col-sm-3 loading" id="expenseReport"></div></div><div class="row">- <div class="col-lg-6 col-md-6 col-sm-6">- {% include 'reports/partials/income-vs-expenses.twig' %}+ <div class="col-lg-6 col-md-6 col-sm-6 loading" id="incomeVsExpenseReport"></div><div class="col-lg-6 col-md-6 col-sm-6">{% include 'reports/partials/tags.twig' %}@@ -84,17 +79,9 @@var reportType = '{{ reportType }}';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 -->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 type="text/javascript" src="js/ff/reports/default/all.js"></script><script type="text/javascript" src="js/ff/reports/default/month.js"></script>diff --git a/resources/views/reports/default/multi-year.twig b/resources/views/reports/default/multi-year.twigindex b631c35ff3..d77e17636d 100644--- a/resources/views/reports/default/multi-year.twig+++ b/resources/views/reports/default/multi-year.twig@@ -33,18 +33,13 @@<div class="row"><div class="col-lg-6 col-md-6 col-sm-6 loading" id="accountReport"></div>- <div class="col-lg-3 col-md-3 col-sm-3">- <!-- income -->- {% include 'reports/partials/income.twig' %}+ <div class="col-lg-3 col-md-3 col-sm-3 loading" id="incomeReport"></div>- <div class="col-lg-3 col-md-3 col-sm-3">- <!-- expenses -->- {% include 'reports/partials/expenses.twig' %}+ <div class="col-lg-3 col-md-3 col-sm-3 loading" id="expenseReport"></div></div><div class="row">- <div class="col-lg-6 col-md-6 col-sm-6">- {% include 'reports/partials/income-vs-expenses.twig' %}+ <div class="col-lg-6 col-md-6 col-sm-6 loading" id="incomeVsExpenseReport"></div><div class="col-lg-6 col-md-6 col-sm-6">{% include 'reports/partials/tags.twig' %}@@ -165,17 +160,9 @@var reportType = '{{ reportType }}';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 -->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 type="text/javascript" src="js/ff/reports/default/all.js"></script>diff --git a/resources/views/reports/default/year.twig b/resources/views/reports/default/year.twigindex 8bf9e86b1f..c65d56d98a 100644--- a/resources/views/reports/default/year.twig+++ b/resources/views/reports/default/year.twig@@ -33,14 +33,12 @@<div class="col-lg-6 col-md-6 col-sm-6"><div class="loading" id="accountReport"></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 class="col-lg-3 col-md-3 col-sm-3 loading" id="incomeReport"></div>- <div class="col-lg-3 col-md-3 col-sm-3">- {% include 'reports/partials/expenses.twig' %}+ <div class="col-lg-3 col-md-3 col-sm-3 loading" id="expenseReport"></div></div><div class="row">@@ -125,18 +123,9 @@var reportType = '{{ reportType }}';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 -->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 type="text/javascript" src="js/ff/reports/default/all.js"></script>diff --git a/resources/views/reports/partials/expenses.twig b/resources/views/reports/partials/expenses.twigindex 69a3881f9a..a2465c390b 100644--- a/resources/views/reports/partials/expenses.twig+++ b/resources/views/reports/partials/expenses.twig@@ -6,8 +6,8 @@<table class="table table-hover"><tbody>{% for expense in expenses.getExpenses %}- {% if loop.index > expenseTopLength %}- <tr class="collapse out expenseCollapsed">+ {% if loop.index > listLength %}+ <tr class="overListLength">{% else %}<tr>{% endif %}@@ -32,7 +32,7 @@{% if expenses.getExpenses|length > expenseTopLength %}<tr><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></tr>{% endif %}diff --git a/resources/views/reports/partials/income.twig b/resources/views/reports/partials/income.twigindex 8674c74258..6d47763b9f 100644--- a/resources/views/reports/partials/income.twig+++ b/resources/views/reports/partials/income.twig@@ -6,8 +6,8 @@<table class="table table-hover"><tbody>{% for income in incomes.getIncomes %}- {% if loop.index > incomeTopLength %}- <tr class="collapse out incomesCollapsed">+ {% if loop.index > listLength %}+ <tr class="overListLength">{% else %}<tr>{% endif %}@@ -23,15 +23,16 @@{% endif %}</td>+<td>{{ income.amount|formatAmount }}</td></tr>{% endfor %}</tbody><tfoot>- {% if incomes.getIncomes|length > incomeTopLength %}+ {% if incomes.getIncomes|length > listLength %}<tr><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></tr>{% endif %}diff --git a/routes/web.php b/routes/web.phpindex c22422058d..c9243d04f2 100755--- a/routes/web.php+++ b/routes/web.php@@ -317,11 +317,18 @@ Route::group(/*** Report AJAX data Controller:*/+ // account reportRoute::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']);+ // income report+ Route::get(+ '/reports/data/in-out-report/{start_date}/{end_date}/{accountList}',+ ['uses' => 'Report\InOutController@inOutReport', 'as' => 'reports.data.inOutReport']+ );+/*** Rules Controller*/