From 347ec1d4412e0dce6b79f4e2579be25c74a3d786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 10 Aug 2020 17:31:23 +0200 Subject: [PATCH] Check if $entity is App\Models\Quote to make sure right variables are passed --- app/Services/PdfMaker/Designs/Bold.php | 4 ++++ app/Services/PdfMaker/Designs/Business.php | 4 ++++ app/Services/PdfMaker/Designs/Clean.php | 4 ++++ app/Services/PdfMaker/Designs/Creative.php | 4 ++++ app/Services/PdfMaker/Designs/Elegant.php | 4 ++++ app/Services/PdfMaker/Designs/Hipster.php | 4 ++++ app/Services/PdfMaker/Designs/Modern.php | 4 ++++ app/Services/PdfMaker/Designs/Plain.php | 4 ++++ app/Services/PdfMaker/Designs/Playful.php | 4 ++++ 9 files changed, 36 insertions(+) diff --git a/app/Services/PdfMaker/Designs/Bold.php b/app/Services/PdfMaker/Designs/Bold.php index cebddd7d7ab2..3e43f9b18966 100644 --- a/app/Services/PdfMaker/Designs/Bold.php +++ b/app/Services/PdfMaker/Designs/Bold.php @@ -117,6 +117,10 @@ class Bold extends BaseDesign { $variables = $this->entity->company->settings->pdf_variables->invoice_details; + if ($this->entity instanceof \App\Models\Quote) { + $variables = $this->entity->company->settings->pdf_variables->quote_details; + } + $elements = []; foreach ($variables as $variable) { diff --git a/app/Services/PdfMaker/Designs/Business.php b/app/Services/PdfMaker/Designs/Business.php index 05fcc461cc83..ed86575e7433 100644 --- a/app/Services/PdfMaker/Designs/Business.php +++ b/app/Services/PdfMaker/Designs/Business.php @@ -117,6 +117,10 @@ class Business extends BaseDesign { $variables = $this->entity->company->settings->pdf_variables->invoice_details; + if ($this->entity instanceof \App\Models\Quote) { + $variables = $this->entity->company->settings->pdf_variables->quote_details; + } + $elements = []; foreach ($variables as $variable) { diff --git a/app/Services/PdfMaker/Designs/Clean.php b/app/Services/PdfMaker/Designs/Clean.php index 267ce5e561ac..047761cc1a67 100644 --- a/app/Services/PdfMaker/Designs/Clean.php +++ b/app/Services/PdfMaker/Designs/Clean.php @@ -104,6 +104,10 @@ class Clean extends BaseDesign { $variables = $this->entity->company->settings->pdf_variables->invoice_details; + if ($this->entity instanceof \App\Models\Quote) { + $variables = $this->entity->company->settings->pdf_variables->quote_details; + } + $elements = []; foreach ($variables as $variable) { diff --git a/app/Services/PdfMaker/Designs/Creative.php b/app/Services/PdfMaker/Designs/Creative.php index eace96b28e86..a4b2e38ea578 100644 --- a/app/Services/PdfMaker/Designs/Creative.php +++ b/app/Services/PdfMaker/Designs/Creative.php @@ -117,6 +117,10 @@ class Creative extends BaseDesign { $variables = $this->entity->company->settings->pdf_variables->invoice_details; + if ($this->entity instanceof \App\Models\Quote) { + $variables = $this->entity->company->settings->pdf_variables->quote_details; + } + $elements = []; foreach ($variables as $variable) { diff --git a/app/Services/PdfMaker/Designs/Elegant.php b/app/Services/PdfMaker/Designs/Elegant.php index 37f9edddb221..c2a518bbfef6 100644 --- a/app/Services/PdfMaker/Designs/Elegant.php +++ b/app/Services/PdfMaker/Designs/Elegant.php @@ -78,6 +78,10 @@ class Elegant extends BaseDesign { $variables = $this->entity->company->settings->pdf_variables->invoice_details; + if ($this->entity instanceof \App\Models\Quote) { + $variables = $this->entity->company->settings->pdf_variables->quote_details; + } + $elements = []; foreach ($variables as $variable) { diff --git a/app/Services/PdfMaker/Designs/Hipster.php b/app/Services/PdfMaker/Designs/Hipster.php index 7ccea85decfb..21c14d904bc0 100644 --- a/app/Services/PdfMaker/Designs/Hipster.php +++ b/app/Services/PdfMaker/Designs/Hipster.php @@ -117,6 +117,10 @@ class Hipster extends BaseDesign { $variables = $this->entity->company->settings->pdf_variables->invoice_details; + if ($this->entity instanceof \App\Models\Quote) { + $variables = $this->entity->company->settings->pdf_variables->quote_details; + } + $elements = []; foreach ($variables as $variable) { diff --git a/app/Services/PdfMaker/Designs/Modern.php b/app/Services/PdfMaker/Designs/Modern.php index 7710f00bca28..96dfa8c83306 100644 --- a/app/Services/PdfMaker/Designs/Modern.php +++ b/app/Services/PdfMaker/Designs/Modern.php @@ -78,6 +78,10 @@ class Modern extends BaseDesign { $variables = $this->entity->company->settings->pdf_variables->invoice_details; + if ($this->entity instanceof \App\Models\Quote) { + $variables = $this->entity->company->settings->pdf_variables->quote_details; + } + $elements = []; foreach ($variables as $variable) { diff --git a/app/Services/PdfMaker/Designs/Plain.php b/app/Services/PdfMaker/Designs/Plain.php index 9755adfd6f9e..0094b0b62e84 100644 --- a/app/Services/PdfMaker/Designs/Plain.php +++ b/app/Services/PdfMaker/Designs/Plain.php @@ -87,6 +87,10 @@ class Plain extends BaseDesign { $variables = $this->entity->company->settings->pdf_variables->invoice_details; + if ($this->entity instanceof \App\Models\Quote) { + $variables = $this->entity->company->settings->pdf_variables->quote_details; + } + $elements = []; foreach ($variables as $variable) { diff --git a/app/Services/PdfMaker/Designs/Playful.php b/app/Services/PdfMaker/Designs/Playful.php index 59bf78e29ace..7b7372abdf67 100644 --- a/app/Services/PdfMaker/Designs/Playful.php +++ b/app/Services/PdfMaker/Designs/Playful.php @@ -78,6 +78,10 @@ class Playful extends BaseDesign { $variables = $this->entity->company->settings->pdf_variables->invoice_details; + if ($this->entity instanceof \App\Models\Quote) { + $variables = $this->entity->company->settings->pdf_variables->quote_details; + } + $elements = []; foreach ($variables as $variable) {