mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Repository and test clean up.
This commit is contained in:
@@ -197,18 +197,6 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get account of transaction that is more than zero. Only works with unsplit journals.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public function getDestinationAccount(TransactionJournal $journal): Account
|
||||
{
|
||||
return $journal->transactions()->where('amount', '<', 0)->first()->account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the first positive transaction for the journal. Useful when editing journals.
|
||||
*
|
||||
@@ -438,18 +426,6 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
return $note->text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get account of transaction that is less than zero. Only works with unsplit journals.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public function getSourceAccount(TransactionJournal $journal): Account
|
||||
{
|
||||
return $journal->transactions()->where('amount', '>', 0)->first()->account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all tags as strings in an array.
|
||||
*
|
||||
@@ -542,6 +518,22 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $transactionId
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function reconcileById(int $transactionId): bool
|
||||
{
|
||||
/** @var Transaction $transaction */
|
||||
$transaction = $this->user->transactions()->find($transactionId);
|
||||
if (!is_null($transaction)) {
|
||||
return $this->reconcile($transaction);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
* @param int $order
|
||||
|
Reference in New Issue
Block a user