From a302891bec805a4deb376bcd97ffecfaf8e8408a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 12 Aug 2020 19:14:14 +0200 Subject: [PATCH] Change $pdf_variables scope --- app/Jobs/Invoice/CreateInvoicePdf.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Jobs/Invoice/CreateInvoicePdf.php b/app/Jobs/Invoice/CreateInvoicePdf.php index 791001100289..d014f1bc11e2 100644 --- a/app/Jobs/Invoice/CreateInvoicePdf.php +++ b/app/Jobs/Invoice/CreateInvoicePdf.php @@ -92,16 +92,13 @@ class CreateInvoicePdf implements ShouldQueue $design_class = new $design_namespace(); - $product_table_columns = json_decode( - json_encode($this->invoice->company->settings->pdf_variables), - 1 - )['product_columns']; + $pdf_variables = json_decode(json_encode($this->invoice->company->settings->pdf_variables), 1); $state = [ 'template' => $design_class->elements([ 'client' => $this->invoice->client, 'entity' => $this->invoice, - 'product-table-columns' => $product_table_columns, + 'product-table-columns' => $pdf_variables['product_columns'], ]), 'variables' => $html->generateLabelsAndValues(), ]; @@ -112,7 +109,7 @@ class CreateInvoicePdf implements ShouldQueue ->design($design_namespace) ->build(); - info('Done: ' . now()); + info($maker->getCompiledHTML()); //todo - move this to the client creation stage so we don't keep hitting this unnecessarily Storage::makeDirectory($path, 0755);