mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-13 16:00:13 +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) {
|
||||
|
@@ -667,6 +667,7 @@ return [
|
||||
'bill_will_automatch' => 'Bill will automatically linked to matching transactions',
|
||||
'skips_over' => 'skips over',
|
||||
'bill_store_error' => 'An unexpected error occurred while storing your new bill. Please check the log files',
|
||||
'list_inactive_rule' => 'inactive rule',
|
||||
|
||||
// accounts:
|
||||
'details_for_asset' => 'Details for asset account ":name"',
|
||||
|
@@ -73,7 +73,9 @@
|
||||
{% if rules.count > 0 %}
|
||||
<ul>
|
||||
{% for rule in rules %}
|
||||
<li><a href="{{ route('rules.edit', [rule.id]) }}">{{ rule.title }}</a></li>
|
||||
<li><a href="{{ route('rules.edit', [rule.id]) }}">{{ rule.title }}</a>
|
||||
{% if not rule.active %}({{ 'list_inactive_rule'|_|lower }}){% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
@@ -46,7 +46,12 @@
|
||||
{% if entry.rules|length > 0 %}
|
||||
<ul class="list-unstyled">
|
||||
{% for rule in entry.rules %}
|
||||
<li><a href="{{ route('rules.edit', [rule.id]) }}">{{ rule.title }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('rules.edit', [rule.id]) }}">
|
||||
{{ rule.title }}
|
||||
</a>
|
||||
{% if not rule.active %}({{ 'list_inactive_rule'|_|lower }}){% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user