More fixes

This commit is contained in:
Lars Kusch 2023-08-07 21:18:50 +02:00
parent 0c83ca51c5
commit d8a6578be2
2 changed files with 7 additions and 4 deletions

View File

@ -343,6 +343,7 @@ class InvoiceService
})->toArray();
$this->deletePdf();
$this->deleteEInvoice();
return $this;
}
@ -410,6 +411,7 @@ class InvoiceService
$this->invoice = $this->invoice->calc()->getInvoice();
$this->deletePdf();
$this->deleteEInvoice();
/* 24-03-2022 */
$new_balance = $this->invoice->balance;

View File

@ -19,14 +19,15 @@ class MergeEInvoice
public function run(): void
{
$file_path = $this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()). $this->invoice->getFileName("xml");
$file_path_xml = $this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()). $this->invoice->getFileName("xml");
$file_path_pdf = $this->invoice->getFileName();
// $disk = 'public';
$disk = config('filesystems.default');
$file = Storage::disk($disk)->exists($file_path);
$file_xml = Storage::disk($disk)->exists($file_path_xml);
$file_pdf = Storage::disk($disk)->exists($file_path_pdf);
if (! $file) {
if ($file_xml && $file_pdf) {
(new \App\Jobs\Invoice\MergeEInvoice($this->invoice))->handle();
}