@@ -269,10 +269,10 @@ discard block |
||
| 269 | 269 | return; |
| 270 | 270 | } |
| 271 | 271 | $subQuery = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') |
| 272 | - ->whereNull('transaction_journals.deleted_at') |
|
| 273 | - ->whereNull('transactions.deleted_at') |
|
| 274 | - ->groupBy(['transaction_journals.id']) |
|
| 275 | - ->select(['transaction_journals.id', DB::raw('COUNT(transactions.id) AS t_count')]); |
|
| 272 | + ->whereNull('transaction_journals.deleted_at') |
|
| 273 | + ->whereNull('transactions.deleted_at') |
|
| 274 | + ->groupBy(['transaction_journals.id']) |
|
| 275 | + ->select(['transaction_journals.id', DB::raw('COUNT(transactions.id) AS t_count')]); |
|
| 276 | 276 | /** @noinspection PhpStrictTypeCheckingInspection */ |
| 277 | 277 | $result = DB::table(DB::raw('(' . $subQuery->toSql() . ') AS derived')) |
| 278 | 278 | ->mergeBindings($subQuery->getQuery()) |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | Log::debug(sprintf('System default currency is "%s"', $defaultConfig)); |
| 301 | 301 | |
| 302 | 302 | $accounts = Account::leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') |
| 303 | - ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->get(['accounts.*']); |
|
| 303 | + ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->get(['accounts.*']); |
|
| 304 | 304 | /** @var AccountRepositoryInterface $repository */ |
| 305 | 305 | $repository = app(AccountRepositoryInterface::class); |
| 306 | 306 | $accounts->each( |
@@ -386,9 +386,9 @@ discard block |
||
| 386 | 386 | // get the transaction with the asset account in it: |
| 387 | 387 | /** @var Transaction $transaction */ |
| 388 | 388 | $transaction = $journal->transactions() |
| 389 | - ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') |
|
| 390 | - ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') |
|
| 391 | - ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->first(['transactions.*']); |
|
| 389 | + ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') |
|
| 390 | + ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') |
|
| 391 | + ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->first(['transactions.*']); |
|
| 392 | 392 | if (null === $transaction) { |
| 393 | 393 | return; |
| 394 | 394 | } |
@@ -633,9 +633,9 @@ discard block |
||
| 633 | 633 | try { |
| 634 | 634 | /** @var Transaction $opposing */ |
| 635 | 635 | $opposing = Transaction::where('transaction_journal_id', $journalId) |
| 636 | - ->where('amount', $amount)->where('identifier', '=', 0) |
|
| 637 | - ->whereNotIn('id', $processed) |
|
| 638 | - ->first(); |
|
| 636 | + ->where('amount', $amount)->where('identifier', '=', 0) |
|
| 637 | + ->whereNotIn('id', $processed) |
|
| 638 | + ->first(); |
|
| 639 | 639 | } catch (QueryException $e) { |
| 640 | 640 | Log::error($e->getMessage()); |
| 641 | 641 | $this->error('Firefly III could not find the "identifier" field in the "transactions" table.'); |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | ->groupBy(['transaction_journals.id']) |
| 275 | 275 | ->select(['transaction_journals.id', DB::raw('COUNT(transactions.id) AS t_count')]); |
| 276 | 276 | /** @noinspection PhpStrictTypeCheckingInspection */ |
| 277 | - $result = DB::table(DB::raw('(' . $subQuery->toSql() . ') AS derived')) |
|
| 277 | + $result = DB::table(DB::raw('(' . $subQuery->toSql() . ') AS derived')) |
|
| 278 | 278 | ->mergeBindings($subQuery->getQuery()) |
| 279 | 279 | ->where('t_count', '>', 2) |
| 280 | 280 | ->select(['id', 't_count']); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | /** @var AccountRepositoryInterface $repository */ |
| 305 | 305 | $repository = app(AccountRepositoryInterface::class); |
| 306 | 306 | $accounts->each( |
| 307 | - function (Account $account) use ($repository, $defaultConfig) { |
|
| 307 | + function(Account $account) use ($repository, $defaultConfig) { |
|
| 308 | 308 | $repository->setUser($account->user); |
| 309 | 309 | // get users preference, fall back to system pref. |
| 310 | 310 | |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | ->get(['transaction_journals.*']); |
| 383 | 383 | |
| 384 | 384 | $set->each( |
| 385 | - function (TransactionJournal $journal) use ($repository, $accountRepos) { |
|
| 385 | + function(TransactionJournal $journal) use ($repository, $accountRepos) { |
|
| 386 | 386 | // get the transaction with the asset account in it: |
| 387 | 387 | /** @var Transaction $transaction */ |
| 388 | 388 | $transaction = $journal->transactions() |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | } |
| 402 | 402 | $transactions = $journal->transactions()->get(); |
| 403 | 403 | $transactions->each( |
| 404 | - function (Transaction $transaction) use ($currency) { |
|
| 404 | + function(Transaction $transaction) use ($currency) { |
|
| 405 | 405 | if (null === $transaction->transaction_currency_id) { |
| 406 | 406 | $transaction->transaction_currency_id = $currency->id; |
| 407 | 407 | $transaction->save(); |
@@ -442,12 +442,12 @@ discard block |
||
| 442 | 442 | ->get(['transaction_journals.*']); |
| 443 | 443 | |
| 444 | 444 | $set->each( |
| 445 | - function (TransactionJournal $transfer) { |
|
| 445 | + function(TransactionJournal $transfer) { |
|
| 446 | 446 | // select all "source" transactions: |
| 447 | 447 | /** @var Collection $transactions */ |
| 448 | 448 | $transactions = $transfer->transactions()->where('amount', '<', 0)->get(); |
| 449 | 449 | $transactions->each( |
| 450 | - function (Transaction $transaction) { |
|
| 450 | + function(Transaction $transaction) { |
|
| 451 | 451 | $this->updateTransactionCurrency($transaction); |
| 452 | 452 | $this->updateJournalCurrency($transaction); |
| 453 | 453 | } |