added test for recurring
This commit is contained in:
@ -112,11 +112,6 @@ class RecurringCheck extends Command
|
||||
foreach ($schedules as $schedule) {
|
||||
$schedule_date = Date::parse($schedule->getStart()->format('Y-m-d'));
|
||||
|
||||
// Don't recur the future
|
||||
if ($schedule_date->greaterThan($today)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->recur($model, $recur->recurable_type, $schedule_date);
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class SendDocumentRecurringNotification
|
||||
|
||||
// Notify all users assigned to this company
|
||||
foreach ($document->company->users as $user) {
|
||||
if (!$user->can('read-notifications')) {
|
||||
if ($user->cannot('read-notifications')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -87,15 +87,15 @@ trait Recurring
|
||||
->setFreq($this->getRecurringRuleFrequency())
|
||||
->setInterval($this->getRecurringRuleInterval());
|
||||
|
||||
if ($set_until_date) {
|
||||
$rule->setUntil($this->getRecurringRuleUntilDate());
|
||||
}
|
||||
|
||||
// 0 means infinite
|
||||
if ($this->count != 0) {
|
||||
$rule->setCount($this->getRecurringRuleCount());
|
||||
}
|
||||
|
||||
if ($set_until_date) {
|
||||
$rule->setUntil($this->getRecurringRuleUntilDate());
|
||||
}
|
||||
|
||||
return $rule;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user