From 5ecb2033dbf5b642d7bdfee67f24c925c3100a59 Mon Sep 17 00:00:00 2001 From: paulwer Date: Wed, 28 Aug 2024 09:53:38 +0200 Subject: [PATCH] fixes --- app/Jobs/Brevo/ProcessBrevoInboundWebhook.php | 8 ++++---- app/Services/EDocument/Imports/MindeeEDocument.php | 2 +- app/Services/EDocument/Imports/ZugferdEDocument.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Jobs/Brevo/ProcessBrevoInboundWebhook.php b/app/Jobs/Brevo/ProcessBrevoInboundWebhook.php index 39617fb032..30f741c69e 100644 --- a/app/Jobs/Brevo/ProcessBrevoInboundWebhook.php +++ b/app/Jobs/Brevo/ProcessBrevoInboundWebhook.php @@ -162,23 +162,23 @@ class ProcessBrevoInboundWebhook implements ShouldQueue // download file and save to tmp dir if (!empty($company_brevo_secret)) { - $attachment = null; + $data = null; try { $brevo = new InboundParsingApi(null, Configuration::getDefaultConfiguration()->setApiKey("api-key", $company_brevo_secret)); - $attachment = $brevo->getInboundEmailAttachment($attachment["DownloadToken"]); + $data = $brevo->getInboundEmailAttachment($attachment["DownloadToken"]); } catch (\Error $e) { if (config('services.brevo.secret')) { nlog("[ProcessBrevoInboundWebhook] Error while downloading with company credentials, we try to use default credentials now..."); $brevo = new InboundParsingApi(null, Configuration::getDefaultConfiguration()->setApiKey("api-key", config('services.brevo.secret'))); - $attachment = $brevo->getInboundEmailAttachment($attachment["DownloadToken"]); + $data = $brevo->getInboundEmailAttachment($attachment["DownloadToken"]); } else throw $e; } - $inboundMail->documents[] = TempFile::UploadedFileFromRaw($attachment, $attachment["Name"], $attachment["ContentType"]); + $inboundMail->documents[] = TempFile::UploadedFileFromRaw($data, $attachment["Name"], $attachment["ContentType"]); } else { diff --git a/app/Services/EDocument/Imports/MindeeEDocument.php b/app/Services/EDocument/Imports/MindeeEDocument.php index 934582e76f..a6e72f33ba 100644 --- a/app/Services/EDocument/Imports/MindeeEDocument.php +++ b/app/Services/EDocument/Imports/MindeeEDocument.php @@ -137,7 +137,7 @@ class MindeeEDocument extends AbstractService } else { // The document exists as an expense // Handle accordingly - nlog("Document already exists"); + nlog("Mindee: Document already exists"); $expense->private_notes = $expense->private_notes . ctrans("texts.edocument_import_already_exists", ["date" => time()]); } $expense->save(); diff --git a/app/Services/EDocument/Imports/ZugferdEDocument.php b/app/Services/EDocument/Imports/ZugferdEDocument.php index ce88ddcfd6..ed7215e54e 100644 --- a/app/Services/EDocument/Imports/ZugferdEDocument.php +++ b/app/Services/EDocument/Imports/ZugferdEDocument.php @@ -140,7 +140,7 @@ class ZugferdEDocument extends AbstractService } else { // The document exists as an expense // Handle accordingly - nlog("Document already exists"); + nlog("Zugferd: Document already exists"); $expense->private_notes = $expense->private_notes . ctrans("texts.edocument_import_already_exists", ["date" => time()]); } $expense->save();