From dff4f762d4775545246f186065f53364f6ffc410 Mon Sep 17 00:00:00 2001 From: Lars Kusch Date: Mon, 3 Apr 2023 21:18:07 +0200 Subject: [PATCH] More fixes --- app/Services/Invoice/InvoiceService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index d28ee76942cb..d1831581b295 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -364,12 +364,12 @@ class InvoiceService $this->invoice->invitations->each(function ($invitation) { try { - if (Storage::disk(config('filesystems.default'))->exists($this->invoice->client->invoice_filepath($invitation).$this->invoice->numberFormatter().'-xinvoice.xml')) { - Storage::disk(config('filesystems.default'))->delete($this->invoice->client->invoice_filepath($invitation).$this->invoice->numberFormatter().'-xinvoice.xml'); + if (Storage::disk(config('filesystems.default'))->exists($this->invoice->client->xinvoice_filepath($invitation).$this->invoice->getFileName("xml"))) { + Storage::disk(config('filesystems.default'))->delete($this->invoice->client->xinvoice_filepath($invitation).$this->invoice->getFileName("xml")); } - if (Ninja::isHosted() && Storage::disk('public')->exists($this->invoice->client->invoice_filepath($invitation).$this->invoice->numberFormatter().'-xinvoice.xml')) { - Storage::disk('public')->delete($this->invoice->client->invoice_filepath($invitation).$this->invoice->numberFormatter().'-xinvoice.xml'); + if (Ninja::isHosted() && Storage::disk('public')->exists($this->invoice->client->invoice_filepath($invitation).$this->invoice->getFileName("xml"))) { + Storage::disk('public')->delete($this->invoice->client->invoice_filepath($invitation).$this->invoice->getFileName("xml")); } } catch (\Exception $e) { nlog($e->getMessage());