mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some code cleanup.
This commit is contained in:
parent
1453a78e49
commit
8c9f90f1b4
@ -220,8 +220,7 @@ class AccountController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param AccountTaskerInterface $tasker
|
* @param JournalCollectorInterface $collector
|
||||||
* @param ARI $repository
|
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
*
|
*
|
||||||
* @return View
|
* @return View
|
||||||
|
@ -204,7 +204,7 @@ class BudgetController extends Controller
|
|||||||
$cache->addProperty('budget');
|
$cache->addProperty('budget');
|
||||||
$cache->addProperty('period');
|
$cache->addProperty('period');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
// return Response::json($cache->get());
|
return Response::json($cache->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
// the expenses:
|
// the expenses:
|
||||||
|
@ -292,7 +292,6 @@ class CategoryReportController extends Controller
|
|||||||
$currentEnd = clone $currentStart;
|
$currentEnd = clone $currentStart;
|
||||||
Log::debug(sprintf('Function is %s', $function));
|
Log::debug(sprintf('Function is %s', $function));
|
||||||
$currentEnd = $currentEnd->$function();
|
$currentEnd = $currentEnd->$function();
|
||||||
//$currentEnd = Navigation::endOfPeriod($current, $period);
|
|
||||||
$expenses = $this->groupByCategory($this->getExpenses($accounts, $categories, $currentStart, $currentEnd));
|
$expenses = $this->groupByCategory($this->getExpenses($accounts, $categories, $currentStart, $currentEnd));
|
||||||
$income = $this->groupByCategory($this->getIncome($accounts, $categories, $currentStart, $currentEnd));
|
$income = $this->groupByCategory($this->getIncome($accounts, $categories, $currentStart, $currentEnd));
|
||||||
$label = $currentStart->formatLocalized(strval(trans('config.' . $format)));
|
$label = $currentStart->formatLocalized(strval(trans('config.' . $format)));
|
||||||
@ -314,7 +313,7 @@ class CategoryReportController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$currentStart = clone $currentEnd;
|
$currentStart = clone $currentEnd;
|
||||||
$currentStart->addDay();// = Navigation::addPeriod($current, $period, 0);
|
$currentStart->addDay();
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $this->generator->mainReportChart($data);
|
$data = $this->generator->mainReportChart($data);
|
||||||
|
@ -168,7 +168,6 @@ class ConvertController extends Controller
|
|||||||
$sourceAccount = TransactionJournal::sourceAccountList($journal)->first();
|
$sourceAccount = TransactionJournal::sourceAccountList($journal)->first();
|
||||||
$destinationAccount = TransactionJournal::destinationAccountList($journal)->first();
|
$destinationAccount = TransactionJournal::destinationAccountList($journal)->first();
|
||||||
$sourceType = $journal->transactionType;
|
$sourceType = $journal->transactionType;
|
||||||
$destination = null;
|
|
||||||
$joined = $sourceType->type . '-' . $destinationType->type;
|
$joined = $sourceType->type . '-' . $destinationType->type;
|
||||||
switch ($joined) {
|
switch ($joined) {
|
||||||
default:
|
default:
|
||||||
|
@ -135,13 +135,14 @@ class Range
|
|||||||
$start = Session::get('start');
|
$start = Session::get('start');
|
||||||
/** @var Carbon $end */
|
/** @var Carbon $end */
|
||||||
$end = Session::get('end');
|
$end = Session::get('end');
|
||||||
if ($viewRange === 'custom') {
|
|
||||||
$days = $start->diffInDays($end);
|
|
||||||
$prevStart = clone $start;
|
$prevStart = clone $start;
|
||||||
$prevStart->subDays($days);
|
|
||||||
$prevEnd = clone $start;
|
$prevEnd = clone $start;
|
||||||
$nextStart = clone $end;
|
$nextStart = clone $end;
|
||||||
$nextEnd = clone $end;
|
$nextEnd = clone $end;
|
||||||
|
if ($viewRange === 'custom') {
|
||||||
|
$days = $start->diffInDays($end);
|
||||||
|
$prevStart->subDays($days);
|
||||||
$nextEnd->addDays($days);
|
$nextEnd->addDays($days);
|
||||||
unset($days);
|
unset($days);
|
||||||
}
|
}
|
||||||
|
@ -374,12 +374,12 @@ Route::group(
|
|||||||
'/reports/data/inc-exp-report/{start_date}/{end_date}/{accountList}',
|
'/reports/data/inc-exp-report/{start_date}/{end_date}/{accountList}',
|
||||||
['uses' => 'Report\InOutController@incExpReport', 'as' => 'reports.data.incExpReport']
|
['uses' => 'Report\InOutController@incExpReport', 'as' => 'reports.data.incExpReport']
|
||||||
);
|
);
|
||||||
// (income report):
|
// income report:
|
||||||
Route::get(
|
Route::get(
|
||||||
'/reports/data/income-report/{start_date}/{end_date}/{accountList}',
|
'/reports/data/income-report/{start_date}/{end_date}/{accountList}',
|
||||||
['uses' => 'Report\InOutController@incomeReport', 'as' => 'reports.data.incomeReport']
|
['uses' => 'Report\InOutController@incomeReport', 'as' => 'reports.data.incomeReport']
|
||||||
);
|
);
|
||||||
// (expense report):
|
// expense report:
|
||||||
Route::get(
|
Route::get(
|
||||||
'/reports/data/expense-report/{start_date}/{end_date}/{accountList}',
|
'/reports/data/expense-report/{start_date}/{end_date}/{accountList}',
|
||||||
['uses' => 'Report\InOutController@expenseReport', 'as' => 'reports.data.expenseReport']
|
['uses' => 'Report\InOutController@expenseReport', 'as' => 'reports.data.expenseReport']
|
||||||
|
Loading…
Reference in New Issue
Block a user