From 9f3a58129f575bf344e2c11af4f92dadd5cb1431 Mon Sep 17 00:00:00 2001 From: Lars Kusch Date: Mon, 7 Aug 2023 09:59:10 +0200 Subject: [PATCH] Removed pdf-parameters --- app/Jobs/Entity/CreateEntityPdf.php | 2 +- app/Jobs/Invoice/CreateEInvoice.php | 2 +- app/Jobs/Invoice/ZipInvoices.php | 2 +- app/Services/Invoice/GetInvoiceEInvoice.php | 2 +- app/Services/Invoice/InvoiceService.php | 4 ++-- tests/Unit/EInvoiceTest.php | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index fe25cd410332..58c60b7cb5ee 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -213,7 +213,7 @@ class CreateEntityPdf implements ShouldQueue } } if ($this->entity_string == "invoice" && $this->client->getSetting('enable_e_invoice')){ - (new CreateEInvoice($this->entity, true))->handle(); + (new CreateEInvoice($this->entity))->handle(); } $this->invitation = null; // $this->entity = null; diff --git a/app/Jobs/Invoice/CreateEInvoice.php b/app/Jobs/Invoice/CreateEInvoice.php index dc2fdfba1d39..e97444705fe3 100644 --- a/app/Jobs/Invoice/CreateEInvoice.php +++ b/app/Jobs/Invoice/CreateEInvoice.php @@ -29,7 +29,7 @@ class CreateEInvoice implements ShouldQueue public $deleteWhenMissingModels = true; - public function __construct(private Invoice $invoice, private bool $alterPDF, private string $custom_pdf_path = "") + public function __construct(private Invoice $invoice) { } diff --git a/app/Jobs/Invoice/ZipInvoices.php b/app/Jobs/Invoice/ZipInvoices.php index 17209446b345..d8c15054343f 100644 --- a/app/Jobs/Invoice/ZipInvoices.php +++ b/app/Jobs/Invoice/ZipInvoices.php @@ -76,7 +76,7 @@ class ZipInvoices implements ShouldQueue $this->invoices->each(function ($invoice) { (new CreateEntityPdf($invoice->invitations()->first()))->handle(); if ($invoice->client->getSetting('enable_e_invoice')){ - (new CreateEInvoice($invoice, false))->handle(); + (new CreateEInvoice($invoice))->handle(); } }); diff --git a/app/Services/Invoice/GetInvoiceEInvoice.php b/app/Services/Invoice/GetInvoiceEInvoice.php index 6b6dac9f544f..b3690eef603c 100644 --- a/app/Services/Invoice/GetInvoiceEInvoice.php +++ b/app/Services/Invoice/GetInvoiceEInvoice.php @@ -43,7 +43,7 @@ class GetInvoiceEInvoice extends AbstractService $file = Storage::disk($disk)->exists($file_path); if (! $file) { - $file_path = (new CreateEInvoice($this->invoice, false))->handle(); + $file_path = (new CreateEInvoice($this->invoice))->handle(); } return $file_path; diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 8558c0128ec6..a024ccaef8ba 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -465,7 +465,7 @@ class InvoiceService if ($invitation->invoice->client->getSetting('enable_e_invoice') && $invitation instanceof InvoiceInvitation) { - (new CreateEInvoice($invitation->invoice, true))->handle(); + (new CreateEInvoice($invitation->invoice))->handle(); } }); @@ -478,7 +478,7 @@ class InvoiceService CreateEntityPdf::dispatch($invitation); if ($invitation->invoice->client->getSetting('enable_e_invoice') && $invitation instanceof InvoiceInvitation) { - CreateEInvoice::dispatch($invitation->invoice, true); + CreateEInvoice::dispatch($invitation->invoice); } }); diff --git a/tests/Unit/EInvoiceTest.php b/tests/Unit/EInvoiceTest.php index 6c31974bf3e9..2a76d5971891 100644 --- a/tests/Unit/EInvoiceTest.php +++ b/tests/Unit/EInvoiceTest.php @@ -42,7 +42,7 @@ class EInvoiceTest extends TestCase $this->company->e_invoice_type = "EN16931"; $this->invoice->client->routing_id = 'DE123456789'; $this->invoice->client->save(); - $xinvoice = (new CreateEInvoice($this->invoice, false))->handle(); + $xinvoice = (new CreateEInvoice($this->invoice))->handle(); $this->assertNotNull($xinvoice); $this->assertTrue(Storage::exists($xinvoice)); } @@ -56,7 +56,7 @@ class EInvoiceTest extends TestCase $this->invoice->client->routing_id = 'DE123456789'; $this->invoice->client->save(); - $xinvoice = (new CreateEInvoice($this->invoice, false))->handle(); + $xinvoice = (new CreateEInvoice($this->invoice))->handle(); nlog(Storage::path($xinvoice)); $document = ZugferdDocumentReader::readAndGuessFromFile(Storage::path($xinvoice)); $document->getDocumentInformation($documentno, $documenttypecode, $documentdate, $documentcurrency, $taxcurrency, $taxname, $documentlangeuage, $rest); @@ -69,7 +69,7 @@ class EInvoiceTest extends TestCase public function checkEmbededPDFFile() { $pdf = (new CreateEntityPdf($this->invoice->invitations()->first()))->handle(); - (new CreateEInvoice($this->invoice, true, $pdf))->handle(); + (new CreateEInvoice($this->invoice))->handle(); $document = ZugferdDocumentReader::readAndGuessFromFile($pdf); $document->getDocumentInformation($documentno, $documenttypecode, $documentdate, $documentcurrency, $taxcurrency, $taxname, $documentlangeuage, $rest); $this->assertEquals($this->invoice->number, $documentno);