mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Make sure limits exist in rule engine.
This commit is contained in:
parent
41f2339c8c
commit
28698cc769
@ -130,6 +130,18 @@ class ApplyRules extends Command
|
||||
$ruleEngine->setRules($rulesToApply);
|
||||
$ruleEngine->setUser($this->getUser());
|
||||
|
||||
// add the accounts as filter:
|
||||
$accounts = [];
|
||||
foreach($this->accounts as $account) {
|
||||
$accounts[] = $account->id;
|
||||
}
|
||||
$list = implode(',', $accounts);
|
||||
$ruleEngine->addOperator(['type' => 'account_id', 'value' => $list]);
|
||||
|
||||
// add the date as a filter:
|
||||
$ruleEngine->addOperator(['type' => 'date_after', 'value' => $this->startDate->format('Y-m-d')]);
|
||||
$ruleEngine->addOperator(['type' => 'date_before', 'value' => $this->endDate->format('Y-m-d')]);
|
||||
|
||||
// start running rules.
|
||||
$this->line(sprintf('Will apply %d rule(s) to your transaction(s).', $count));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user