Add Notification class to DocumentReminded event
This commit is contained in:
@ -10,6 +10,7 @@ use App\Models\Banking\Transaction;
|
||||
use App\Models\Common\Company;
|
||||
use App\Models\Common\Recurring;
|
||||
use App\Models\Document\Document;
|
||||
use App\Notifications\Sale\Invoice as Notification;
|
||||
use App\Utilities\Date;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
@ -122,6 +123,7 @@ class RecurringCheck extends Command
|
||||
protected function recur($model, $type, $schedule_date)
|
||||
{
|
||||
\DB::transaction(function () use ($model, $type, $schedule_date) {
|
||||
/** @var Document $clone */
|
||||
if (!$clone = $this->getClone($model, $schedule_date)) {
|
||||
return;
|
||||
}
|
||||
@ -130,7 +132,9 @@ class RecurringCheck extends Command
|
||||
case 'App\Models\Document\Document':
|
||||
event(new DocumentCreated($clone, request()));
|
||||
|
||||
event(new DocumentRecurring($clone));
|
||||
if ($clone->type === Document::INVOICE_TYPE) {
|
||||
event(new DocumentRecurring($clone, Notification::class));
|
||||
}
|
||||
|
||||
break;
|
||||
case 'App\Models\Banking\Transaction':
|
||||
|
Reference in New Issue
Block a user