Various code clean up.

This commit is contained in:
James Cole 2017-06-07 07:38:58 +02:00
parent 51ddcd9ee1
commit e5db5a7b5c
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
8 changed files with 20 additions and 17 deletions

View File

@ -183,6 +183,7 @@ class BudgetController extends Controller
$start = new Carbon($moment);
$end = Navigation::endOfPeriod($start, $range);
} catch (Exception $e) {
// start and end are already defined.
}
}

View File

@ -349,7 +349,7 @@ class AccountController extends Controller
$cache->addProperty('chart.account.period');
$cache->addProperty($account->id);
if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore
return Response::json($cache->get()); // @codeCoverageIgnore
}
$format = (string)trans('config.month_and_day');

View File

@ -174,14 +174,17 @@ class ConvertController extends Controller
switch ($joined) {
default:
throw new FireflyException('Cannot handle ' . $joined); // @codeCoverageIgnore
case TransactionType::WITHDRAWAL . '-' . TransactionType::DEPOSIT: // one
case TransactionType::WITHDRAWAL . '-' . TransactionType::DEPOSIT:
// one
$destination = $sourceAccount;
break;
case TransactionType::WITHDRAWAL . '-' . TransactionType::TRANSFER: // two
case TransactionType::WITHDRAWAL . '-' . TransactionType::TRANSFER:
// two
$destination = $accountRepository->find(intval($data['destination_account_asset']));
break;
case TransactionType::DEPOSIT . '-' . TransactionType::WITHDRAWAL: // three
case TransactionType::TRANSFER . '-' . TransactionType::WITHDRAWAL: // five
case TransactionType::DEPOSIT . '-' . TransactionType::WITHDRAWAL:
case TransactionType::TRANSFER . '-' . TransactionType::WITHDRAWAL:
// three and five
if ($data['destination_account_expense'] === '') {
// destination is a cash account.
$destination = $accountRepository->getCashAccount();
@ -197,8 +200,9 @@ class ConvertController extends Controller
];
$destination = $accountRepository->store($data);
break;
case TransactionType::DEPOSIT . '-' . TransactionType::TRANSFER: // four
case TransactionType::TRANSFER . '-' . TransactionType::DEPOSIT: // six
case TransactionType::DEPOSIT . '-' . TransactionType::TRANSFER:
case TransactionType::TRANSFER . '-' . TransactionType::DEPOSIT:
// four and six
$destination = $destinationAccount;
break;
}

View File

@ -53,7 +53,7 @@ class Search implements SearchInterface
public function __construct()
{
$this->modifiers = new Collection;
$this->validModifiers = config('firefly.search_modifiers');
$this->validModifiers = (array) config('firefly.search_modifiers');
}
/**

View File

@ -135,7 +135,7 @@ class Steam
$cache->addProperty($start);
$cache->addProperty($end);
if ($cache->has()) {
//return $cache->get(); // @codeCoverageIgnore
return $cache->get(); // @codeCoverageIgnore
}
$start->subDay();
@ -167,10 +167,6 @@ class Steam
]
);
// echo '<pre>';
// var_dump($set->toArray());
// exit;
$currentBalance = $startBalance;
/** @var Transaction $entry */
foreach ($set as $entry) {
@ -217,7 +213,7 @@ class Steam
$cache->addProperty('balances');
$cache->addProperty($date);
if ($cache->has()) {
//return $cache->get(); // @codeCoverageIgnore
return $cache->get(); // @codeCoverageIgnore
}
// need to do this per account.

View File

@ -8,7 +8,7 @@
* See the LICENSE file for details.
*/
/** global: budgetChartUri, expenseCategoryUri, expenseAssetUri, expenseExpenseUri */
/** global: budgetChartUri, expenseCategoryUri, expenseAssetUri, expenseExpenseUri, budgetLimitID */
$(function () {
"use strict";

View File

@ -32,8 +32,6 @@ $(document).ready(function () {
*/
function updateInitialPage() {
console.log('Native currency is #' + journalData.native_currency.id + ' and (foreign) currency id is #' + journalData.currency.id);
if (journal.transaction_type.type === "Transfer") {
$('#native_amount_holder').hide();
$('#amount_holder').hide();

View File

@ -87,6 +87,10 @@ then
# call test data generation script
$(which php) /sites/FF3/test-data/artisan generate:data local sqlite
# also run upgrade routine:
$(which php) /sites/FF3/firefly-iii/artisan firefly:upgrade-database
# copy new database over backup (resets backup)
cp $DATABASE $DATABASECOPY
fi