Removed pdf-parameters

This commit is contained in:
Lars Kusch 2023-08-07 09:59:10 +02:00
parent 24239009a6
commit 9f3a58129f
6 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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)
{
}

View File

@ -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();
}
});

View File

@ -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;

View File

@ -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);
}
});

View File

@ -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);