Skip to content

Firefly III: a personal finances manager

Fix #11473

James Cole466b42200d48
diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php
index 4c001e60c4..128fbe9f2c 100644
--- a/app/Helpers/Collector/Extensions/MetaCollection.php
+++ b/app/Helpers/Collector/Extensions/MetaCollection.php
@@ -784,14 +784,22 @@ trait MetaCollection
$filter = static function (array $object) use ($list): bool {
Log::debug(sprintf('Now in setTags(%s) filter', implode(', ', $list)));
foreach ($object['transactions'] as $transaction) {
+ $total = count($transaction['tags']);
+ $matched = 0;
foreach ($transaction['tags'] as $tag) {
Log::debug(sprintf('"%s" versus', strtolower((string) $tag['name'])), $list);
if (in_array(strtolower((string) $tag['name']), $list, true)) {
Log::debug(sprintf('Transaction has tag "%s" so return true.', $tag['name']));
-
- return true;
+ $matched++;
+ if(1 === count($list)) {
+ return true;
+ }
}
}
+ if(count($list) > 1 && $total === $matched && $matched === count($list)) {
+ Log::debug(sprintf('All %d searched tags are present.', $total));
+ return true;
+ }
}
Log::debug('Transaction has no tags from the list, so return false.');
diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php
index fad31a7f0e..5bda050c6d 100644
--- a/app/Support/Navigation.php
+++ b/app/Support/Navigation.php
@@ -202,7 +202,6 @@ class Navigation
public function endOfPeriod(Carbon $end, string $repeatFreq): Carbon
{
$currentEnd = clone $end;
-
// Log::debug(sprintf('Now in endOfPeriod("%s", "%s").', $currentEnd->toIso8601String(), $repeatFreq));
if ('MTD' === $repeatFreq && $end->isFuture()) {
// fall back to a monthly schedule if the requested period is MTD.
@@ -325,6 +324,7 @@ class Navigation
}
unset($result);
+
if (!array_key_exists($repeatFreq, $functionMap)) {
Log::error(sprintf('Cannot do endOfPeriod for $repeat_freq "%s"', $repeatFreq));