fixed #572
This commit is contained in:
parent
ff01b4ff04
commit
abad89a873
@ -63,25 +63,22 @@ class RecurringCheck extends Command
|
||||
|
||||
$company->setSettings();
|
||||
|
||||
foreach ($company->recurring as $recur) {
|
||||
if (!$current = $recur->current()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$current_date = Date::parse($current->format('Y-m-d'));
|
||||
foreach ($company->recurring as $recurring) {
|
||||
foreach ($recurring->schedule() as $recur) {
|
||||
$recur_date = Date::parse($recur->getStart()->format('Y-m-d'));
|
||||
|
||||
// Check if should recur today
|
||||
if ($this->today->ne($current_date)) {
|
||||
if ($this->today->ne($recur_date)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$model = $recur->recurable;
|
||||
$model = $recurring->recurable;
|
||||
|
||||
if (!$model) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch ($recur->recurable_type) {
|
||||
switch ($recurring->recurable_type) {
|
||||
case 'App\Models\Expense\Bill':
|
||||
$this->recurBill($company, $model);
|
||||
break;
|
||||
@ -103,6 +100,7 @@ class RecurringCheck extends Command
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Unset company_id
|
||||
session()->forget('company_id');
|
||||
|
Loading…
x
Reference in New Issue
Block a user