Skip to content

Firefly III: a personal finances manager

Remove code.

James Coleb248bd6d0c4b
diff --git a/app/TransactionRules/Triggers/BudgetIs.php b/app/TransactionRules/Triggers/BudgetIs.php
index fa6997a281..272ae84ae1 100644
--- a/app/TransactionRules/Triggers/BudgetIs.php
+++ b/app/TransactionRules/Triggers/BudgetIs.php
@@ -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;
diff --git a/app/TransactionRules/Triggers/CategoryIs.php b/app/TransactionRules/Triggers/CategoryIs.php
index df09b9bba7..2388139623 100644
--- a/app/TransactionRules/Triggers/CategoryIs.php
+++ b/app/TransactionRules/Triggers/CategoryIs.php
@@ -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;