diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 493adf003d..8ebc14802d 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -220,9 +220,8 @@ class AccountController extends Controller } /** - * @param AccountTaskerInterface $tasker - * @param ARI $repository - * @param Account $account + * @param JournalCollectorInterface $collector + * @param Account $account * * @return View */ diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 2016b2f224..b2da79b704 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -204,7 +204,7 @@ class BudgetController extends Controller $cache->addProperty('budget'); $cache->addProperty('period'); if ($cache->has()) { - // return Response::json($cache->get()); + return Response::json($cache->get()); } // the expenses: diff --git a/app/Http/Controllers/Chart/CategoryReportController.php b/app/Http/Controllers/Chart/CategoryReportController.php index 5bca2ddbd0..3fa10a8b07 100644 --- a/app/Http/Controllers/Chart/CategoryReportController.php +++ b/app/Http/Controllers/Chart/CategoryReportController.php @@ -292,10 +292,9 @@ class CategoryReportController extends Controller $currentEnd = clone $currentStart; Log::debug(sprintf('Function is %s', $function)); $currentEnd = $currentEnd->$function(); - //$currentEnd = Navigation::endOfPeriod($current, $period); - $expenses = $this->groupByCategory($this->getExpenses($accounts, $categories, $currentStart, $currentEnd)); - $income = $this->groupByCategory($this->getIncome($accounts, $categories, $currentStart, $currentEnd)); - $label = $currentStart->formatLocalized(strval(trans('config.' . $format))); + $expenses = $this->groupByCategory($this->getExpenses($accounts, $categories, $currentStart, $currentEnd)); + $income = $this->groupByCategory($this->getIncome($accounts, $categories, $currentStart, $currentEnd)); + $label = $currentStart->formatLocalized(strval(trans('config.' . $format))); Log::debug(sprintf('Now grabbing CMC expenses between %s and %s', $currentStart->format('Y-m-d'), $currentEnd->format('Y-m-d'))); @@ -314,7 +313,7 @@ class CategoryReportController extends Controller } $currentStart = clone $currentEnd; - $currentStart->addDay();// = Navigation::addPeriod($current, $period, 0); + $currentStart->addDay(); } $data = $this->generator->mainReportChart($data); diff --git a/app/Http/Controllers/Transaction/ConvertController.php b/app/Http/Controllers/Transaction/ConvertController.php index 1941da2f6a..434300face 100644 --- a/app/Http/Controllers/Transaction/ConvertController.php +++ b/app/Http/Controllers/Transaction/ConvertController.php @@ -168,7 +168,6 @@ class ConvertController extends Controller $sourceAccount = TransactionJournal::sourceAccountList($journal)->first(); $destinationAccount = TransactionJournal::destinationAccountList($journal)->first(); $sourceType = $journal->transactionType; - $destination = null; $joined = $sourceType->type . '-' . $destinationType->type; switch ($joined) { default: diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index cedce6ab74..05240cb62c 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -135,13 +135,14 @@ class Range $start = Session::get('start'); /** @var Carbon $end */ $end = Session::get('end'); + + $prevStart = clone $start; + $prevEnd = clone $start; + $nextStart = clone $end; + $nextEnd = clone $end; if ($viewRange === 'custom') { - $days = $start->diffInDays($end); - $prevStart = clone $start; + $days = $start->diffInDays($end); $prevStart->subDays($days); - $prevEnd = clone $start; - $nextStart = clone $end; - $nextEnd = clone $end; $nextEnd->addDays($days); unset($days); } diff --git a/routes/web.php b/routes/web.php index d66442dbb9..9409bae581 100755 --- a/routes/web.php +++ b/routes/web.php @@ -374,12 +374,12 @@ Route::group( '/reports/data/inc-exp-report/{start_date}/{end_date}/{accountList}', ['uses' => 'Report\InOutController@incExpReport', 'as' => 'reports.data.incExpReport'] ); - // (income report): + // income report: Route::get( '/reports/data/income-report/{start_date}/{end_date}/{accountList}', ['uses' => 'Report\InOutController@incomeReport', 'as' => 'reports.data.incomeReport'] ); - // (expense report): + // expense report: Route::get( '/reports/data/expense-report/{start_date}/{end_date}/{accountList}', ['uses' => 'Report\InOutController@expenseReport', 'as' => 'reports.data.expenseReport']