mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 08:00:19 +00:00
List rules as inactive if relevant #1392
This commit is contained in:
@@ -393,11 +393,11 @@ class BillRepository implements BillRepositoryInterface
|
||||
$rules = $this->user->rules()
|
||||
->leftJoin('rule_actions', 'rule_actions.rule_id', '=', 'rules.id')
|
||||
->where('rule_actions.action_type', 'link_to_bill')
|
||||
->get(['rules.id', 'rules.title', 'rule_actions.action_value']);
|
||||
->get(['rules.id', 'rules.title', 'rule_actions.action_value','rules.active']);
|
||||
$array = [];
|
||||
foreach ($rules as $rule) {
|
||||
$array[$rule->action_value] = $array[$rule->action_value] ?? [];
|
||||
$array[$rule->action_value][] = ['id' => $rule->id, 'title' => $rule->title];
|
||||
$array[$rule->action_value][] = ['id' => $rule->id, 'title' => $rule->title,'active' => $rule->active];
|
||||
}
|
||||
$return = [];
|
||||
foreach ($collection as $bill) {
|
||||
|
||||
Reference in New Issue
Block a user