From f81e7da8bb542fac0e4f57602e70479dbc07cb9b Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 28 Dec 2015 07:49:27 +0100 Subject: [PATCH] Code cleanup. --- app/Helpers/Report/ReportQuery.php | 9 --------- app/Http/Controllers/Chart/CategoryController.php | 2 +- app/Http/Controllers/ReportController.php | 2 -- app/Http/routes.php | 2 +- app/Repositories/Bill/BillRepository.php | 2 +- app/Repositories/Budget/BudgetRepository.php | 2 -- 6 files changed, 3 insertions(+), 16 deletions(-) diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index 54798674f5..ae484d8095 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -161,15 +161,6 @@ class ReportQuery implements ReportQueryInterface } } ); - // $data = $data->filter( - // function (TransactionJournal $journal) { - // if ($journal->amount != 0) { - // return $journal; - // } - // - // return null; - // } - // ); return $data; } diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 7d685a9cc4..6d97762f22 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -329,7 +329,7 @@ class CategoryController extends Controller $categories = $categories->merge($set); // save the set combined with the data that is in it: // for example: - // [december 2015, salary:1000, bonus:200] + // december 2015, salary:1000, bonus:200 $sets->push([$currentStart, $set]); $start->addMonth(); } diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index fd4bcebeff..bbe78ce268 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -215,7 +215,6 @@ class ReportController extends Controller // more than one year date difference means year report. if ($start->diffInMonths($end) > 12) { - // return view('error')->with('message', 'No report yet for this time period.'); return $this->defaultMultiYear($report_type, $start, $end, $accounts); } // more than two months date difference means year report. @@ -224,7 +223,6 @@ class ReportController extends Controller } return $this->defaultMonth($report_type, $start, $end, $accounts); - break; } diff --git a/app/Http/routes.php b/app/Http/routes.php index 8b2917884f..ac043af6f3 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -30,7 +30,7 @@ Route::bind( throw new NotFoundHttpException; } ); -// account list! Yay! +// accounts Route::bind( 'accountList', function ($value) { diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 3af068660c..1e08433502 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -76,7 +76,7 @@ class BillRepository implements BillRepositoryInterface $set = $set->filter( function (Bill $bill) use ($ids) { // get transaction journals from or to any of the mentioned accounts. - // if zero, return null. + // when zero, return null. $journals = $bill->transactionjournals()->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') ->whereIn('transactions.account_id', $ids)->count(); diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 15069ba946..a38cd42261 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -190,8 +190,6 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn ->where('limit_repetitions.startdate', $start->format('Y-m-d 00:00:00')) ->where('limit_repetitions.enddate', $end->format('Y-m-d 00:00:00')) ->first(['limit_repetitions.*']); - //Log::debug('Looking for limit reps for budget #' . $budget->id . ' start [' . $start . '] and end [' . $end . '].'); - //Log::debug(DB::getQueryLog()) $cache->store($data); return $data;