mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
Fix #11473
This commit is contained in:
@@ -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.');
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user