Use different method for finding objects.

This commit is contained in:
James Cole
2018-02-28 20:23:45 +01:00
parent fdd2dedfc6
commit 54ba18975a
10 changed files with 36 additions and 38 deletions

View File

@@ -185,7 +185,7 @@ class AccountController extends Controller
// the opening balance is tricky:
$openingBalanceAmount = strval($repository->getOpeningBalanceAmount($account));
$openingBalanceDate = $repository->getOpeningBalanceDate($account);
$currency = $this->currencyRepos->find(intval($account->getMeta('currency_id')));
$currency = $this->currencyRepos->findNull(intval($account->getMeta('currency_id')));
$preFilled = [
'accountNumber' => $account->getMeta('accountNumber'),
@@ -304,7 +304,7 @@ class AccountController extends Controller
$page = intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$currencyId = intval($account->getMeta('currency_id'));
$currency = $this->currencyRepos->find($currencyId);
$currency = $this->currencyRepos->findNull($currencyId);
if (0 === $currencyId) {
$currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore
}