diff --git a/app/Http/Controllers/Rule/SelectController.php b/app/Http/Controllers/Rule/SelectController.php index 807b6588fb..8833590a09 100644 --- a/app/Http/Controllers/Rule/SelectController.php +++ b/app/Http/Controllers/Rule/SelectController.php @@ -128,6 +128,10 @@ class SelectController extends Controller */ public function selectTransactions(Rule $rule) { + if(false===$rule->active) { + session()->flash('warning',trans('firefly.cannot_fire_inactive_rules')); + return redirect(route('rules.index')); + } // does the user have shared accounts? $first = session('first', Carbon::now()->subYear())->format('Y-m-d'); $today = Carbon::now()->format('Y-m-d'); diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index f71931885b..3a69b9b949 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -298,6 +298,7 @@ return [ 'yearly' => 'yearly', // rules + 'cannot_fire_inactive_rules' => 'You cannot execute inactive rules.', 'rules' => 'Rules', 'rule_name' => 'Name of rule', 'rule_triggers' => 'Rule triggers when', diff --git a/resources/views/v1/rules/index.twig b/resources/views/v1/rules/index.twig index e1090a2a00..61c8863a3c 100644 --- a/resources/views/v1/rules/index.twig +++ b/resources/views/v1/rules/index.twig @@ -107,6 +107,7 @@
{# show which transactions would match #} + {% if rule.active %} @@ -115,7 +116,7 @@ - + {% endif %} {# duplicate rule #}