mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Should fix the last issues.
This commit is contained in:
parent
52df2edc8f
commit
af13d1943f
@ -406,7 +406,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
'iban' => '',
|
||||
];
|
||||
$opposing = $this->storeAccount($opposingData);
|
||||
if (!is_null($opposing)) {
|
||||
if (!is_null($opposing) && !is_null($newAccount)) {
|
||||
$this->storeInitialBalance($newAccount, $opposing, $data);
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
}
|
||||
|
||||
// store accounts (depends on type)
|
||||
list($from, $to) = $this->storeAccounts($journal->transactionType, $data);
|
||||
list($fromAccount, $toAccount) = $this->storeAccounts($journal->transactionType, $data);
|
||||
|
||||
// update the from and to transaction.
|
||||
/** @var Transaction $transaction */
|
||||
@ -256,12 +256,12 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
if (floatval($transaction->amount) < 0) {
|
||||
// this is the from transaction, negative amount:
|
||||
$transaction->amount = $data['amount'] * -1;
|
||||
$transaction->account_id = $from->id;
|
||||
$transaction->account_id = $fromAccount->id;
|
||||
$transaction->save();
|
||||
}
|
||||
if (floatval($transaction->amount) > 0) {
|
||||
$transaction->amount = $data['amount'];
|
||||
$transaction->account_id = $to->id;
|
||||
$transaction->account_id = $toAccount->id;
|
||||
$transaction->save();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user