mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remove code.
This commit is contained in:
parent
3fff9ad0a2
commit
b248bd6d0c
@ -22,7 +22,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\TransactionRules\Triggers;
|
||||
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Log;
|
||||
|
||||
@ -76,31 +75,6 @@ final class BudgetIs extends AbstractTrigger implements TriggerInterface
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (null === $budget) {
|
||||
// perhaps transactions have this budget?
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($journal->transactions as $transaction) {
|
||||
$budget = $transaction->budgets()->first();
|
||||
if (null !== $budget) {
|
||||
$name = strtolower($budget->name);
|
||||
if ($name === strtolower($this->triggerValue)) {
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'RuleTrigger BudgetIs for journal #%d (transaction #%d): "%s" is "%s", return true.',
|
||||
$journal->id,
|
||||
$transaction->id,
|
||||
$name,
|
||||
$this->triggerValue
|
||||
)
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log::debug(sprintf('RuleTrigger BudgetIs for journal #%d: does not have budget "%s", return false.', $journal->id, $this->triggerValue));
|
||||
|
||||
return false;
|
||||
|
@ -22,7 +22,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\TransactionRules\Triggers;
|
||||
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Log;
|
||||
|
||||
@ -76,31 +75,6 @@ final class CategoryIs extends AbstractTrigger implements TriggerInterface
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (null === $category) {
|
||||
// perhaps transactions have this category?
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($journal->transactions as $transaction) {
|
||||
$category = $transaction->categories()->first();
|
||||
if (null !== $category) {
|
||||
$name = strtolower($category->name);
|
||||
if ($name === strtolower($this->triggerValue)) {
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'RuleTrigger CategoryIs for journal #%d (transaction #%d): "%s" is "%s", return true.',
|
||||
$journal->id,
|
||||
$transaction->id,
|
||||
$name,
|
||||
$this->triggerValue
|
||||
)
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log::debug(sprintf('RuleTrigger CategoryIs for journal #%d: does not have category "%s", return false.', $journal->id, $this->triggerValue));
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user