Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix for #2070
James Cole0d0906c5e2dc
diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.phpindex 244e786e99..1f4bd93eed 100644--- a/app/Repositories/Journal/JournalRepository.php+++ b/app/Repositories/Journal/JournalRepository.php@@ -383,15 +383,16 @@ class JournalRepository implements JournalRepositoryInterface* Return a list of all destination accounts related to journal.** @param TransactionJournal $journal+ * @param bool $useCache** @return Collection*/- public function getJournalDestinationAccounts(TransactionJournal $journal): Collection+ public function getJournalDestinationAccounts(TransactionJournal $journal, bool $useCache = true): Collection{$cache = new CacheProperties;$cache->addProperty($journal->id);$cache->addProperty('destination-account-list');- if ($cache->has()) {+ if ($useCache && $cache->has()) {return $cache->get(); // @codeCoverageIgnore}$transactions = $journal->transactions()->where('amount', '>', 0)->orderBy('transactions.account_id')->with('account')->get();@@ -410,15 +411,16 @@ class JournalRepository implements JournalRepositoryInterface* Return a list of all source accounts related to journal.** @param TransactionJournal $journal+ * @param bool $useCache** @return Collection*/- public function getJournalSourceAccounts(TransactionJournal $journal): Collection+ public function getJournalSourceAccounts(TransactionJournal $journal, bool $useCache = true): Collection{$cache = new CacheProperties;$cache->addProperty($journal->id);$cache->addProperty('source-account-list');- if ($cache->has()) {+ if ($useCache && $cache->has()) {return $cache->get(); // @codeCoverageIgnore}$transactions = $journal->transactions()->where('amount', '<', 0)->orderBy('transactions.account_id')->with('account')->get();