diff --git a/app/Generator/Chart/Account/AccountChartGenerator.php b/app/Generator/Chart/Account/AccountChartGenerator.php index d64876c7d6..5969d86178 100644 --- a/app/Generator/Chart/Account/AccountChartGenerator.php +++ b/app/Generator/Chart/Account/AccountChartGenerator.php @@ -14,15 +14,6 @@ use Illuminate\Support\Collection; interface AccountChartGenerator { - /** - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return array - */ - public function all(Collection $accounts, Carbon $start, Carbon $end); - /** * @param Collection $accounts * @param Carbon $start diff --git a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php index 194e667633..4ba98ba113 100644 --- a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php +++ b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php @@ -17,21 +17,6 @@ use Steam; class ChartJsAccountChartGenerator implements AccountChartGenerator { - - /** - * @codeCoverageIgnore - * - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return array - */ - public function all(Collection $accounts, Carbon $start, Carbon $end) - { - return $this->frontpage($accounts, $start, $end); - } - /** * @param Collection $accounts * @param Carbon $start diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index a7df17912f..e1961e6c06 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -34,51 +34,6 @@ class AccountController extends Controller } - /** - * Shows the balances for all the user's accounts. - * - * @param AccountRepositoryInterface $repository - * - * @param $year - * @param $month - * @param bool $shared - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function all(AccountRepositoryInterface $repository, $year, $month, $shared = false) - { - $start = new Carbon($year . '-' . $month . '-01'); - $end = clone $start; - $end->endOfMonth(); - - // chart properties for cache: - $cache = new CacheProperties(); - $cache->addProperty($start); - $cache->addProperty($end); - $cache->addProperty('all'); - $cache->addProperty('accounts'); - if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore - } - - /** @var Collection $accounts */ - $accounts = $repository->getAccounts(['Default account', 'Asset account']); - if ($shared === false) { - /** @var Account $account */ - foreach ($accounts as $index => $account) { - if ($account->getMeta('accountRole') == 'sharedAsset') { - $accounts->forget($index); - } - } - } - - // make chart: - $data = $this->generator->all($accounts, $start, $end); - $cache->store($data); - - return Response::json($data); - } - /** * Shows the balances for a given set of dates and accounts. * diff --git a/app/Http/routes.php b/app/Http/routes.php index fd6ac41c4c..8b2917884f 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -389,9 +389,6 @@ Route::group( // accounts: Route::get('/chart/account/frontpage', ['uses' => 'Chart\AccountController@frontpage']); Route::get('/chart/account/expense', ['uses' => 'Chart\AccountController@expenseAccounts']); - Route::get('/chart/account/month/{year}/{month}/{shared?}', ['uses' => 'Chart\AccountController@all'])->where( - ['year' => '[0-9]{4}', 'month' => '[0-9]{1,2}', 'shared' => 'shared'] - ); Route::get('/chart/account/report/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\AccountController@report']); Route::get('/chart/account/{account}', ['uses' => 'Chart\AccountController@single']); @@ -428,12 +425,8 @@ Route::group( Route::get('/chart/piggyBank/{piggyBank}', ['uses' => 'Chart\PiggyBankController@history']); // reports: - Route::get('/chart/report/in-out/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOut'])->where( - ['year' => '[0-9]{4}', 'shared' => 'shared'] - ); - Route::get('/chart/report/in-out-sum/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOutSummarized'])->where( - ['year' => '[0-9]{4}', 'shared' => 'shared'] - ); + Route::get('/chart/report/in-out/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOut']); + Route::get('/chart/report/in-out-sum/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOutSummarized']); /** diff --git a/public/js/reports/default/reports.js b/public/js/reports/default/reports.js index 10997093bc..23adac5fcd 100644 --- a/public/js/reports/default/reports.js +++ b/public/js/reports/default/reports.js @@ -115,10 +115,6 @@ function drawChart() { stackedColumnChart('chart/category/earned-in-year/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'categories-earned-in-year'); } - //if (typeof lineChart !== 'undefined' && typeof month !== 'undefined' && typeof reportURL === 'undefined') { - // lineChart('/chart/account/month/' + year + '/' + month + shared, 'account-balances-chart'); - //} - if (typeof lineChart !== 'undefined' && typeof accountIds !== 'undefined') { lineChart('/chart/account/report/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'account-balances-chart'); }