From 0d0c80b7d18a6a99dc800d738546e8b08768ca30 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 23 Feb 2023 22:03:21 +1100 Subject: [PATCH] Refactor PDF Service --- app/Services/Pdf/PdfService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Services/Pdf/PdfService.php b/app/Services/Pdf/PdfService.php index 46c6c0b8e49f..ee33da426fef 100644 --- a/app/Services/Pdf/PdfService.php +++ b/app/Services/Pdf/PdfService.php @@ -61,8 +61,6 @@ class PdfService $this->account = $this->company->account; - $this->config = (new PdfConfiguration($this))->init(); - $this->document_type = $document_type; $this->options = $options; @@ -122,6 +120,9 @@ class PdfService public function init(): self { + $this->config = (new PdfConfiguration($this))->init(); + + $this->html_variables = $this->config->client ? (new HtmlEngine($this->invitation))->generateLabelsAndValues() : (new VendorHtmlEngine($this->invitation))->generateLabelsAndValues();