mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 12:28:46 +00:00
Small bug fix in the import routine.
This commit is contained in:
@@ -310,16 +310,19 @@ class Import
|
|||||||
if (is_null($account)) {
|
if (is_null($account)) {
|
||||||
\Log::debug('Cash account is needed.');
|
\Log::debug('Cash account is needed.');
|
||||||
$account = $this->_accounts->getCashAccount();
|
$account = $this->_accounts->getCashAccount();
|
||||||
\Log::info($account);
|
|
||||||
}
|
}
|
||||||
|
// find
|
||||||
|
|
||||||
foreach ($journal->transactions as $transaction) {
|
foreach ($journal->transactions as $transaction) {
|
||||||
if ($transaction->account()->first()->account_type_id == 5) {
|
$accountType = $transaction->account->accounttype->type;
|
||||||
|
if ($accountType == 'Import account') {
|
||||||
$transaction->account()->associate($account);
|
$transaction->account()->associate($account);
|
||||||
$transaction->save();
|
$transaction->save();
|
||||||
\Log::debug(
|
\Log::debug(
|
||||||
'Updated transactions (#' . $journal->id . '), #' . $transaction->id . '\'s Account.'
|
'Updated transactions (#' . $journal->id . '), #' . $transaction->id . '\'s Account.'
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
\Log::error('Found account type: "' . $accountType.'" instead of expected "Import account"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user