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