Various code cleanup.

This commit is contained in:
James Cole
2018-03-25 09:01:43 +02:00
parent dd9694890a
commit 6660306ac4
46 changed files with 327 additions and 121 deletions

View File

@@ -54,7 +54,7 @@ class JavascriptController extends Controller
/** @var Account $account */
foreach ($accounts as $account) {
$accountId = $account->id;
$currency = intval($account->getMeta('currency_id'));
$currency = intval($repository->getMetaValue($account, 'currency_id'));
$currency = 0 === $currency ? $default->id : $currency;
$entry = ['preferredCurrency' => $currency, 'name' => $account->name];
$data['accounts'][$accountId] = $entry;
@@ -98,7 +98,7 @@ class JavascriptController extends Controller
$account = $repository->findNull(intval($request->get('account')));
$currencyId = 0;
if (null !== $account) {
$currencyId = intval($account->getMeta('currency_id'));
$currencyId = intval($repository->getMetaValue($account, 'currency_id'));
}
/** @var TransactionCurrency $currency */
$currency = $currencyRepository->findNull($currencyId);