diff --git a/app/Console/Commands/CreateSingleAccount.php b/app/Console/Commands/CreateSingleAccount.php index 0c1d8fa4477a..0a106b63ce08 100644 --- a/app/Console/Commands/CreateSingleAccount.php +++ b/app/Console/Commands/CreateSingleAccount.php @@ -189,7 +189,7 @@ class CreateSingleAccount extends Command $this->createClient($company, $user); } - CreateCompanyTaskStatuses::dispatchNow($company, $user); + (new CreateCompanyTaskStatuses($company, $user))->handle(); for ($x = 0; $x < $this->count; $x++) { $client = $company->clients->random(); diff --git a/app/Console/Commands/SendRemindersCron.php b/app/Console/Commands/SendRemindersCron.php index 81e20ec819b3..f8f69a30dd60 100644 --- a/app/Console/Commands/SendRemindersCron.php +++ b/app/Console/Commands/SendRemindersCron.php @@ -97,10 +97,6 @@ class SendRemindersCron extends Command } }); - // SendReminders::dispatchNow(); - - // $this->webHookOverdueInvoices(); - // $this->webHookExpiredQuotes(); } private function calcLateFee($invoice, $template) :Invoice diff --git a/app/Http/Controllers/PreviewPurchaseOrderController.php b/app/Http/Controllers/PreviewPurchaseOrderController.php index f8b287570715..e159e02101e2 100644 --- a/app/Http/Controllers/PreviewPurchaseOrderController.php +++ b/app/Http/Controllers/PreviewPurchaseOrderController.php @@ -173,7 +173,7 @@ class PreviewPurchaseOrderController extends BaseController } //else - $file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company()); + $file_path = (new PreviewPdf($maker->getCompiledHTML(true), auth()->user()->company()))->handle(); return response()->download($file_path, basename($file_path), ['Cache-Control:' => 'no-cache'])->deleteFileAfterSend(true); } @@ -285,7 +285,7 @@ class PreviewPurchaseOrderController extends BaseController return $pdf; } - $file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), $company); + $file_path = (new PreviewPdf($maker->getCompiledHTML(true), $company))->handle(); if(Ninja::isHosted()) @@ -363,7 +363,7 @@ class PreviewPurchaseOrderController extends BaseController return $pdf; } - $file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company()); + $file_path = (new PreviewPdf($maker->getCompiledHTML(true), auth()->user()->company()))->handle(); $response = Response::make($file_path, 200); $response->header('Content-Type', 'application/pdf'); @@ -460,7 +460,7 @@ class PreviewPurchaseOrderController extends BaseController return $pdf; } - $file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company()); + $file_path = (new PreviewPdf($maker->getCompiledHTML(true), auth()->user()->company()))->handle(); $response = Response::make($file_path, 200); $response->header('Content-Type', 'application/pdf'); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index e2c4008b3a35..e34151fb4893 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -210,7 +210,7 @@ class UserController extends BaseController $user_agent = request()->input('token_name') ?: request()->server('HTTP_USER_AGENT'); - $ct = CreateCompanyToken::dispatchNow($company, $user, $user_agent); + $ct = (new CreateCompanyToken($company, $user, $user_agent))->handle(); event(new UserWasCreated($user, auth()->user(), $company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); diff --git a/app/Http/Controllers/VendorPortal/InvitationController.php b/app/Http/Controllers/VendorPortal/InvitationController.php index 4a295a6e646b..8c016a666e93 100644 --- a/app/Http/Controllers/VendorPortal/InvitationController.php +++ b/app/Http/Controllers/VendorPortal/InvitationController.php @@ -108,8 +108,6 @@ class InvitationController extends Controller $file_name = $invitation->purchase_order->numberFormatter().'.pdf'; - // $file = CreateRawPdf::dispatchNow($invitation, $invitation->company->db); - $file = (new CreatePurchaseOrderPdf($invitation))->rawPdf(); $headers = ['Content-Type' => 'application/pdf']; diff --git a/app/Http/Livewire/BillingPortalPurchase.php b/app/Http/Livewire/BillingPortalPurchase.php index c24f0139410c..3433f07a58df 100644 --- a/app/Http/Livewire/BillingPortalPurchase.php +++ b/app/Http/Livewire/BillingPortalPurchase.php @@ -507,7 +507,7 @@ class BillingPortalPurchase extends Component $mailer->settings = $this->subscription->company->settings; $mailer->to_user = $contact; - NinjaMailerJob::dispatchNow($mailer); + NinjaMailerJob::dispatch($mailer); $this->steps['passwordless_login_sent'] = true; $this->passwordless_login_btn = false; diff --git a/app/Jobs/Company/CompanyImport.php b/app/Jobs/Company/CompanyImport.php index 2207fbbd6407..f62aa6b7268a 100644 --- a/app/Jobs/Company/CompanyImport.php +++ b/app/Jobs/Company/CompanyImport.php @@ -288,7 +288,7 @@ class CompanyImport implements ShouldQueue $nmo->company = $_company; $nmo->settings = $_company->settings; $nmo->to_user = $_company->owner(); - NinjaMailerJob::dispatchNow($nmo); + NinjaMailerJob::dispatch($nmo); } catch(\Exception $e){ @@ -1644,7 +1644,7 @@ class CompanyImport implements ShouldQueue $nmo->company = $this->company; $nmo->settings = $this->company->settings; $nmo->to_user = $this->company->owner(); - NinjaMailerJob::dispatchNow($nmo); + NinjaMailerJob::dispatch($nmo); } } \ No newline at end of file diff --git a/app/Jobs/Ninja/CheckCompanyData.php b/app/Jobs/Ninja/CheckCompanyData.php index 4dc2f481bfb5..1751f5f7cf98 100644 --- a/app/Jobs/Ninja/CheckCompanyData.php +++ b/app/Jobs/Ninja/CheckCompanyData.php @@ -52,8 +52,6 @@ class CheckCompanyData implements ShouldQueue /** * Execute the job. - * - * @return void */ public function handle() { diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index 1210d4d7b062..7a987808d14c 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -252,7 +252,7 @@ class Import implements ShouldQueue $this->setInitialCompanyLedgerBalances(); // $this->fixClientBalances(); - $check_data = CheckCompanyData::dispatchNow($this->company, md5(time())); + $check_data = (new CheckCompanyData($this->company, md5(time())))->handle(); // if(Ninja::isHosted() && array_key_exists('ninja_tokens', $data)) $this->processNinjaTokens($data['ninja_tokens']); @@ -591,7 +591,7 @@ class Import implements ShouldQueue $user_agent = array_key_exists('token_name', $resource) ?: request()->server('HTTP_USER_AGENT'); - CreateCompanyToken::dispatchNow($this->company, $user, $user_agent); + (new CreateCompanyToken($this->company, $user, $user_agent))->handle(); $key = "users_{$resource['id']}"; @@ -1899,7 +1899,7 @@ class Import implements ShouldQueue if(Ninja::isHosted()){ try{ - \Modules\Admin\Jobs\Account\NinjaUser::dispatchNow($data, $this->company); + \Modules\Admin\Jobs\Account\NinjaUser::dispatch($data, $this->company); } catch(\Exception $e){ nlog($e->getMessage()); diff --git a/app/Models/PurchaseOrder.php b/app/Models/PurchaseOrder.php index f8195fe6f226..851822e09841 100644 --- a/app/Models/PurchaseOrder.php +++ b/app/Models/PurchaseOrder.php @@ -212,14 +212,14 @@ class PurchaseOrder extends BaseModel return Storage::disk(config('filesystems.default'))->{$type}($file_path); } elseif(Ninja::isHosted() && $portal){ - $file_path = CreatePurchaseOrderPdf::dispatchNow($invitation,config('filesystems.default')); + $file_path = (new CreatePurchaseOrderPdf($invitation,config('filesystems.default')))->handle(); return Storage::disk(config('filesystems.default'))->{$type}($file_path); } if(Storage::disk('public')->exists($file_path)) return Storage::disk('public')->{$type}($file_path); - $file_path = CreatePurchaseOrderPdf::dispatchNow($invitation); + $file_path = (new CreatePurchaseOrderPdf($invitation))->handle(); return Storage::disk('public')->{$type}($file_path); } diff --git a/app/Services/Credit/ApplyNumber.php b/app/Services/Credit/ApplyNumber.php index 00f5b7074422..75ba418bccb5 100644 --- a/app/Services/Credit/ApplyNumber.php +++ b/app/Services/Credit/ApplyNumber.php @@ -59,7 +59,7 @@ class ApplyNumber extends AbstractService } catch (QueryException $e) { $x++; - if ($x > 10) { + if ($x > 50) { $this->completed = false; } } diff --git a/app/Services/Invoice/ApplyNumber.php b/app/Services/Invoice/ApplyNumber.php index 325991ab67ec..58b976eb2b86 100644 --- a/app/Services/Invoice/ApplyNumber.php +++ b/app/Services/Invoice/ApplyNumber.php @@ -77,7 +77,7 @@ class ApplyNumber extends AbstractService $x++; - if($x>10) + if($x>50) $this->completed = false; } diff --git a/app/Services/Payment/ApplyNumber.php b/app/Services/Payment/ApplyNumber.php index d8654c216743..9345867cd176 100644 --- a/app/Services/Payment/ApplyNumber.php +++ b/app/Services/Payment/ApplyNumber.php @@ -56,7 +56,7 @@ class ApplyNumber extends AbstractService } catch (QueryException $e) { $x++; - if ($x > 10) { + if ($x > 50) { $this->completed = false; } } diff --git a/app/Services/PurchaseOrder/PurchaseOrderService.php b/app/Services/PurchaseOrder/PurchaseOrderService.php index 1cabb4dd7fd8..34a18e574894 100644 --- a/app/Services/PurchaseOrder/PurchaseOrderService.php +++ b/app/Services/PurchaseOrder/PurchaseOrderService.php @@ -104,7 +104,7 @@ class PurchaseOrderService if($force){ $this->purchase_order->invitations->each(function ($invitation) { - CreatePurchaseOrderPdf::dispatchNow($invitation); + (new CreatePurchaseOrderPdf($invitation))->handle(); }); return $this; diff --git a/app/Services/Quote/ApplyNumber.php b/app/Services/Quote/ApplyNumber.php index 9b8c69b5fb14..2f1bc4541830 100644 --- a/app/Services/Quote/ApplyNumber.php +++ b/app/Services/Quote/ApplyNumber.php @@ -67,7 +67,7 @@ class ApplyNumber } catch (QueryException $e) { $x++; - if ($x > 10) { + if ($x > 50) { $this->completed = false; } } diff --git a/app/Services/Recurring/RecurringService.php b/app/Services/Recurring/RecurringService.php index e4ac54840230..a1d9193550b4 100644 --- a/app/Services/Recurring/RecurringService.php +++ b/app/Services/Recurring/RecurringService.php @@ -88,7 +88,7 @@ class RecurringService $this->recurring_entity->invitations->each(function ($invitation){ - UnlinkFile::dispatchNow(config('filesystems.default'), $this->recurring_entity->client->recurring_invoice_filepath($invitation) . $this->recurring_entity->numberFormatter().'.pdf'); + (new UnlinkFile(config('filesystems.default'), $this->recurring_entity->client->recurring_invoice_filepath($invitation) . $this->recurring_entity->numberFormatter().'.pdf'))->handle(); });