Some code cleanup.

This commit is contained in:
James Cole
2016-05-20 08:00:35 +02:00
parent ed948cc965
commit dda3082c7e
13 changed files with 17 additions and 20 deletions

View File

@@ -223,8 +223,9 @@ class AccountController extends Controller
if ($cache->has()) {
// $entries = $cache->get();
// return view('accounts.show', compact('account', 'what', 'entries', 'subTitleIcon', 'journals', 'subTitle'));
$entries = $cache->get();
return view('accounts.show', compact('account', 'what', 'entries', 'subTitleIcon', 'journals', 'subTitle'));
}
while ($end >= $start) {

View File

@@ -176,12 +176,7 @@ class BudgetController extends Controller
$accounts = $accountRepository->getAccountsByType(['Default account', 'Asset account', 'Cash account']);
$startAsString = $start->format('Y-m-d');
$endAsString = $end->format('Y-m-d');
/**
* Do some cleanup:
* TODO reimplement the deletion of budget_limits and limit_repetitions with amount 0
*/
// loop the budgets:
/** @var Budget $budget */
foreach ($budgets as $budget) {

View File

@@ -131,9 +131,8 @@ class PiggyBankController extends Controller
/*
* Flash some data to fill the form.
*/
if (!is_null($piggyBank->targetdate) || !$piggyBank->targetdate == '') {
$targetDate = new Carbon($piggyBank->targetdate);
$targetDate = $targetDate->format('Y-m-d');
if (!is_null($piggyBank->targetdate)) {
$targetDate = $piggyBank->targetdate->format('Y-m-d');
}
$preFilled = ['name' => $piggyBank->name,

View File

@@ -194,9 +194,9 @@ class ReportController extends Controller
*/
$auditData[$id]['journals'] = $journals->reverse();
$auditData[$id]['exists'] = $exists;
$auditData[$id]['end'] = $end->formatLocalized(trans('config.month_and_day'));
$auditData[$id]['end'] = $end->formatLocalized(strval(trans('config.month_and_day')));
$auditData[$id]['endBalance'] = Steam::balance($account, $end);
$auditData[$id]['dayBefore'] = $dayBefore->formatLocalized(trans('config.month_and_day'));
$auditData[$id]['dayBefore'] = $dayBefore->formatLocalized(strval(trans('config.month_and_day')));
$auditData[$id]['dayBeforeBalance'] = $dayBeforeBalance;
}

View File

@@ -198,8 +198,6 @@ class SplitController extends Controller
*/
private function arrayFromJournal(Request $request, TransactionJournal $journal): array
{
if (Session::has('_old_input')) {
}
$sourceAccounts = TransactionJournal::sourceAccountList($journal);
$destinationAccounts = TransactionJournal::destinationAccountList($journal);
$array = [