From 2c209d2775a0ed1849e5941dce8133402714660d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 5 Apr 2024 19:14:29 +1100 Subject: [PATCH] Fixes for builds --- .github/workflows/react_release.yml | 3 ++- .github/workflows/release.yml | 3 ++- app/Services/Invoice/GenerateDeliveryNote.php | 15 ++++++++------- app/Services/PdfMaker/PdfMaker.php | 1 - 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/react_release.yml b/.github/workflows/react_release.yml index f94ad90e6c..2c795b37dd 100644 --- a/.github/workflows/react_release.yml +++ b/.github/workflows/react_release.yml @@ -49,7 +49,8 @@ jobs: npm i npm run build cp -r dist/* ../public/ - + cp dist/index.html ../resources/views/react/index.blade.php + - name: Prepare JS/CSS assets run: | npm i diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c78bcbe76..8204134564 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,8 @@ jobs: mkdir -p ../public/react/${{ github.event.release.tag_name }}/ cp -r dist/react/* ../public/react/${{ github.event.release.tag_name }}/ cp -r dist/react/* ../public/react/ - + cp dist/index.html ../resources/views/react/index.blade.php + mkdir -p ../public/tinymce_6.4.2/tinymce/js/ cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/ cd .. diff --git a/app/Services/Invoice/GenerateDeliveryNote.php b/app/Services/Invoice/GenerateDeliveryNote.php index 1aa96da0a4..ee4ab5e83c 100644 --- a/app/Services/Invoice/GenerateDeliveryNote.php +++ b/app/Services/Invoice/GenerateDeliveryNote.php @@ -64,8 +64,8 @@ class GenerateDeliveryNote : $this->decodePrimaryKey($this->invoice->client->getSetting('invoice_design_id')); $invitation = $this->invoice->invitations->first(); - // $file_path = sprintf('%s%s_delivery_note.pdf', $this->invoice->client->invoice_filepath($invitation), $this->invoice->number); - $file_path = sprintf('%sdelivery_note.pdf', $this->invoice->client->invoice_filepath($invitation)); + + // return (new \App\Services\Pdf\PdfService($invitation, 'delivery_note'))->boot()->getPdf(); if (config('ninja.phantomjs_pdf_generation') || config('ninja.pdf_generator') == 'phantom') { return (new Phantom())->generate($this->invoice->invitations->first()); @@ -81,6 +81,9 @@ class GenerateDeliveryNote $template = new PdfMakerDesign(strtolower($design->name)); } + $variables = $html->generateLabelsAndValues(); + $variables['labels']['$entity_label']= ctrans('texts.delivery_note'); + $state = [ 'template' => $template->elements([ 'client' => $this->invoice->client, @@ -88,7 +91,7 @@ class GenerateDeliveryNote 'pdf_variables' => (array) $this->invoice->company->settings->pdf_variables, 'contact' => $this->contact, ], 'delivery_note'), - 'variables' => $html->generateLabelsAndValues(), + 'variables' => $variables, 'options' => [ 'client' => $this->invoice->client, 'entity' => $this->invoice, @@ -113,12 +116,10 @@ class GenerateDeliveryNote info($maker->getCompiledHTML()); } - return $pdf; - // Storage::disk($this->disk)->put($file_path, $pdf); - $maker = null; $state = null; - // return $file_path; + return $pdf; + } } diff --git a/app/Services/PdfMaker/PdfMaker.php b/app/Services/PdfMaker/PdfMaker.php index f7b8718e80..75c2ee6470 100644 --- a/app/Services/PdfMaker/PdfMaker.php +++ b/app/Services/PdfMaker/PdfMaker.php @@ -141,7 +141,6 @@ class PdfMaker { $html = $this->document->saveHTML(); - // nlog($html); return str_replace('%24', '$', $html); } }