From 74b7581354f359a5cceb20a315710ddd9e62453e Mon Sep 17 00:00:00 2001 From: paulwer Date: Tue, 25 Jun 2024 05:48:16 +0200 Subject: [PATCH] allow hosted + enterprise --- app/Services/EDocument/Imports/ParseEDocument.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/EDocument/Imports/ParseEDocument.php b/app/Services/EDocument/Imports/ParseEDocument.php index a278640944..89480728d3 100644 --- a/app/Services/EDocument/Imports/ParseEDocument.php +++ b/app/Services/EDocument/Imports/ParseEDocument.php @@ -38,6 +38,9 @@ class ParseEDocument extends AbstractService public function run(): Expense { + /** @var \App\Models\Account $account */ + $account = auth()->user()->account; + $expense = null; // try to parse via Zugferd lib @@ -57,7 +60,7 @@ class ParseEDocument extends AbstractService // try to parse via mindee lib $mindee_exception = null; - if (Ninja::isSelfHost()) + if (config('services.mindee.api_key') && (Ninja::isSelfHost() || (Ninja::isHosted() && $account->isPaid() && $account->plan == 'enterprise'))) try { $expense = (new MindeeEDocument($this->file))->run(); } catch (Exception $e) {