mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 21:16:47 +00:00
Fix all level 2 issues.
This commit is contained in:
@@ -145,7 +145,7 @@ class DeleteOrphanedTransactions extends Command
|
||||
foreach ($set as $transaction) {
|
||||
// delete journals
|
||||
$journal = TransactionJournal::find((int)$transaction->transaction_journal_id);
|
||||
if ($journal) {
|
||||
if (null !== $journal) {
|
||||
$journal->delete();
|
||||
}
|
||||
Transaction::where('transaction_journal_id', (int)$transaction->transaction_journal_id)->delete();
|
||||
|
||||
@@ -95,7 +95,7 @@ class FixUnevenAmount extends Command
|
||||
{
|
||||
// one of the transactions is bad.
|
||||
$journal = TransactionJournal::find($param);
|
||||
if (!$journal) {
|
||||
if (null === $journal) {
|
||||
return;
|
||||
}
|
||||
/** @var Transaction|null $source */
|
||||
|
||||
@@ -205,7 +205,7 @@ class UpgradeLiabilitiesEight extends Command
|
||||
$source = $openingJournal->transactions()->where('amount', '<', 0)->first();
|
||||
/** @var Transaction|null $dest */
|
||||
$dest = $openingJournal->transactions()->where('amount', '>', 0)->first();
|
||||
if ($source && $dest) {
|
||||
if (null !== $source && null !== $dest) {
|
||||
$sourceId = $source->account_id;
|
||||
$destId = $dest->account_id;
|
||||
$dest->account_id = $sourceId;
|
||||
|
||||
Reference in New Issue
Block a user