mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Various code clean up.
This commit is contained in:
parent
51ddcd9ee1
commit
e5db5a7b5c
@ -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.
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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');
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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.
|
||||
|
@ -8,7 +8,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
/** global: budgetChartUri, expenseCategoryUri, expenseAssetUri, expenseExpenseUri */
|
||||
/** global: budgetChartUri, expenseCategoryUri, expenseAssetUri, expenseExpenseUri, budgetLimitID */
|
||||
|
||||
$(function () {
|
||||
"use strict";
|
||||
|
@ -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();
|
||||
|
4
test.sh
4
test.sh
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user