diff --git a/app/Jobs/Vendor/CreatePurchaseOrderPdf.php b/app/Jobs/Vendor/CreatePurchaseOrderPdf.php index f1433484db6a..d11f62e64f0e 100644 --- a/app/Jobs/Vendor/CreatePurchaseOrderPdf.php +++ b/app/Jobs/Vendor/CreatePurchaseOrderPdf.php @@ -65,6 +65,10 @@ class CreatePurchaseOrderPdf implements ShouldQueue public $vendor; + private string $path = ''; + + private string $file_path = ''; + /** * Create a new job instance. * @@ -96,10 +100,10 @@ class CreatePurchaseOrderPdf implements ShouldQueue try{ - if(!Storage::disk($this->disk)->exists($path)) - Storage::disk($this->disk)->makeDirectory($path, 0775); + if(!Storage::disk($this->disk)->exists($this->path)) + Storage::disk($this->disk)->makeDirectory($this->path, 0775); - Storage::disk($this->disk)->put($file_path, $pdf, 'public'); + Storage::disk($this->disk)->put($this->file_path, $pdf, 'public'); } catch(\Exception $e) @@ -110,7 +114,7 @@ class CreatePurchaseOrderPdf implements ShouldQueue } } - return $file_path; + return $this->file_path; } public function rawPdf() @@ -135,10 +139,10 @@ class CreatePurchaseOrderPdf implements ShouldQueue $entity_design_id = ''; - $path = $this->vendor->purchase_order_filepath($this->invitation); + $this->path = $this->vendor->purchase_order_filepath($this->invitation); $entity_design_id = 'purchase_order_design_id'; - $file_path = $path.$this->entity->numberFormatter().'.pdf'; + $this->file_path = $this->path.$this->entity->numberFormatter().'.pdf'; $entity_design_id = $this->entity->design_id ? $this->entity->design_id : $this->decodePrimaryKey('Wpmbk5ezJn'); diff --git a/app/Models/Account.php b/app/Models/Account.php index 9cde2bf4a055..92fba26d8327 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -373,6 +373,8 @@ class Account extends BaseModel public function getDailyEmailLimit() { + if(Carbon::createFromTimestamp($this->created_at)->diffInDays() == 0) + return 7; if(Carbon::createFromTimestamp($this->created_at)->diffInWeeks() == 0) return 20;