1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-15 07:33:04 +01:00

allow hosted + enterprise

This commit is contained in:
paulwer 2024-06-25 05:48:16 +02:00
parent a626736f2d
commit 74b7581354

View File

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