Fix custom range thing for accounts #1240 [skip ci]

This commit is contained in:
James Cole 2018-03-11 19:01:19 +01:00
parent 5bc8f31c31
commit eb63090387
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -293,12 +293,11 @@ class AccountController extends Controller
if (AccountType::INITIAL_BALANCE === $account->accountType->type) {
return $this->redirectToOriginalAccount($account);
}
$range = Preferences::get('viewRange', '1M')->data;
if (null === $start) {
$start = session('start');
}
if (null === $end) {
$end = app('navigation')->endOfPeriod($start, $range);
$end = session('end');
}
if ($end < $start) {
throw new FireflyException('End is after start!'); // @codeCoverageIgnore