Clean up code.

This commit is contained in:
James Cole
2023-12-10 06:51:59 +01:00
parent c2b22a2bac
commit 46e130fdfe
195 changed files with 973 additions and 984 deletions

View File

@@ -80,7 +80,7 @@ class PiggyBankTransformer extends AbstractTransformer
$piggyBanks = $objects->pluck('id')->toArray();
$accountInfo = Account::whereIn('id', $objects->pluck('account_id')->toArray())->get();
$currencyPreferences = AccountMeta::where('name', '"currency_id"')->whereIn('account_id', $objects->pluck('account_id')->toArray())->get();
$currencies = [];
$currencies = [];
/** @var Account $account */
foreach ($accountInfo as $account) {
$id = $account->id;
@@ -92,7 +92,7 @@ class PiggyBankTransformer extends AbstractTransformer
foreach ($currencyPreferences as $preference) {
$currencyId = (int)$preference->data;
$accountId = $preference->account_id;
$currencies[$currencyId] ??= TransactionJournal::find($currencyId);
$currencies[$currencyId] ??= TransactionJournal::find($currencyId);
$this->currencies[$accountId] = $currencies[$currencyId];
}