From 005b1e521bae0b45c94412d20666449a9c5be37b Mon Sep 17 00:00:00 2001 From: Lars Kusch Date: Tue, 8 Aug 2023 08:14:40 +0200 Subject: [PATCH] Fixes for absolute paths --- app/Jobs/Invoice/MergeEInvoice.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Invoice/MergeEInvoice.php b/app/Jobs/Invoice/MergeEInvoice.php index 671c187e9fd1..9536f15c37d0 100644 --- a/app/Jobs/Invoice/MergeEInvoice.php +++ b/app/Jobs/Invoice/MergeEInvoice.php @@ -48,8 +48,13 @@ class MergeEInvoice implements ShouldQueue { $filepath_pdf = $this->invoice->client->invoice_filepath($this->invoice->invitations->first()) . $this->invoice->getFileName(); $e_invoice_path = $this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()) . $this->invoice->getFileName("xml"); - $document = ZugferdDocumentReader::readAndGuessFromFile($e_invoice_path); $disk = config('filesystems.default'); + $file = Storage::disk($disk)->exists($e_invoice_path); + if (! $file){ + (new CreateEInvoice($this->invoice))->handle(); + } + $document = ZugferdDocumentReader::readAndGuessFromFile(Storage::disk($disk)->path($e_invoice_path)); + if (!Storage::disk($disk)->exists($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()))) { Storage::makeDirectory($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()));