Change $pdf_variables scope

This commit is contained in:
Benjamin Beganović 2020-08-12 19:14:14 +02:00
parent caa704af96
commit a302891bec

View File

@ -92,16 +92,13 @@ class CreateInvoicePdf implements ShouldQueue
$design_class = new $design_namespace(); $design_class = new $design_namespace();
$product_table_columns = json_decode( $pdf_variables = json_decode(json_encode($this->invoice->company->settings->pdf_variables), 1);
json_encode($this->invoice->company->settings->pdf_variables),
1
)['product_columns'];
$state = [ $state = [
'template' => $design_class->elements([ 'template' => $design_class->elements([
'client' => $this->invoice->client, 'client' => $this->invoice->client,
'entity' => $this->invoice, 'entity' => $this->invoice,
'product-table-columns' => $product_table_columns, 'product-table-columns' => $pdf_variables['product_columns'],
]), ]),
'variables' => $html->generateLabelsAndValues(), 'variables' => $html->generateLabelsAndValues(),
]; ];
@ -112,7 +109,7 @@ class CreateInvoicePdf implements ShouldQueue
->design($design_namespace) ->design($design_namespace)
->build(); ->build();
info('Done: ' . now()); info($maker->getCompiledHTML());
//todo - move this to the client creation stage so we don't keep hitting this unnecessarily //todo - move this to the client creation stage so we don't keep hitting this unnecessarily
Storage::makeDirectory($path, 0755); Storage::makeDirectory($path, 0755);