diff --git a/app/Jobs/Cron/AutoBill.php b/app/Jobs/Cron/AutoBill.php index 07b244cbbf..464ab62f3f 100644 --- a/app/Jobs/Cron/AutoBill.php +++ b/app/Jobs/Cron/AutoBill.php @@ -14,10 +14,14 @@ namespace App\Jobs\Cron; use App\Libraries\MultiDB; use App\Models\Invoice; use Illuminate\Foundation\Bus\Dispatchable; +use Illuminate\Bus\Queueable; +use Illuminate\Contracts\Queue\ShouldQueue; +use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Queue\SerializesModels; -class AutoBill +class AutoBill implements ShouldQueue { - use Dispatchable; + use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public $tries = 1; diff --git a/app/Services/Recurring/RecurringService.php b/app/Services/Recurring/RecurringService.php index f02173fbcd..e4ac548402 100644 --- a/app/Services/Recurring/RecurringService.php +++ b/app/Services/Recurring/RecurringService.php @@ -125,7 +125,7 @@ class RecurringService if($this->recurring_entity instanceof RecurringInvoice && $this->recurring_entity->status_id == RecurringInvoice::STATUS_DRAFT){ $this->start()->save(); - SendRecurring::dispatchNow($this->recurring_entity, $this->recurring_entity->company->db); + SendRecurring::dispatch($this->recurring_entity, $this->recurring_entity->company->db); } return $this->recurring_entity;