mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
parent
8e2546da9d
commit
1e733f4c8b
@ -682,6 +682,7 @@ trait MetaCollection
|
||||
$list = $tags->pluck('tag')->toArray();
|
||||
$list = array_map('strtolower', $list);
|
||||
$filter = static function (array $object) use ($list): bool|array {
|
||||
$includedJournals = [];
|
||||
$return = $object;
|
||||
unset($return['transactions']);
|
||||
$return['transactions'] = [];
|
||||
@ -701,10 +702,15 @@ trait MetaCollection
|
||||
if (in_array(strtolower($tag['name']), $list, true)) {
|
||||
app('log')->debug(sprintf('Transaction has tag "%s" so count++.', $tag['name']));
|
||||
++$foundTagCount;
|
||||
$journalId = $transaction['transaction_journal_id'];
|
||||
// #8377 prevent adding a transaction twice when multiple tag searches find this transaction
|
||||
if (!in_array($journalId, $includedJournals, true)) {
|
||||
$includedJournals[] = $journalId;
|
||||
$return['transactions'][] = $transaction;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Log::debug(sprintf('Found %d tags, need at least %d.', $foundTagCount, $expectedTagCount));
|
||||
|
||||
// found at least the expected tags.
|
||||
|
@ -931,7 +931,6 @@ class GroupCollector implements GroupCollectorInterface
|
||||
private function postFilterCollection(Collection $collection): Collection
|
||||
{
|
||||
$currentCollection = $collection;
|
||||
|
||||
app('log')->debug(sprintf('GroupCollector: postFilterCollection has %d filter(s) and %d transaction(s).', count($this->postFilters), count($currentCollection)));
|
||||
|
||||
/**
|
||||
@ -1055,7 +1054,6 @@ class GroupCollector implements GroupCollectorInterface
|
||||
->orderBy('transaction_journals.order', 'ASC')
|
||||
->orderBy('transaction_journals.id', 'DESC')
|
||||
->orderBy('transaction_journals.description', 'DESC')
|
||||
->orderBy('source.amount', 'DESC')
|
||||
;
|
||||
->orderBy('source.amount', 'DESC');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user