Some code cleanup.

This commit is contained in:
James Cole
2016-02-05 15:41:40 +01:00
parent 4ef840e210
commit f5b89ca783
32 changed files with 183 additions and 72 deletions

View File

@@ -90,7 +90,9 @@ class HomeController extends Controller
$mainTitleIcon = 'fa-fire';
$transactions = [];
$frontPage = Preferences::get('frontPageAccounts', []);
/** @var Carbon $start */
$start = session('start', Carbon::now()->startOfMonth());
/** @var Carbon $end */
$end = session('end', Carbon::now()->endOfMonth());
$showTour = Preferences::get('tour', true)->data;
$accounts = $repository->getFrontpageAccounts($frontPage);
@@ -105,11 +107,11 @@ class HomeController extends Controller
$sum = $repository->sumOfEverything();
if ($sum != 0) {
if (bccomp($sum, '0') !== 0) {
Session::flash(
'error', 'Your transactions are unbalanced. This means a'
. ' withdrawal, deposit or transfer was not stored properly. '
. 'Please check your accounts and transactions for errors.'
. 'Please check your accounts and transactions for errors (' . $sum . ').'
);
}