mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
Various code clean up.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user