1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-15 07:33:04 +01:00
This commit is contained in:
paulwer 2024-06-26 19:05:14 +02:00
parent 8616adb437
commit f44559869a

View File

@ -32,6 +32,8 @@ class ParseEDocument extends AbstractService
* Execute the service. * Execute the service.
* the service will parse the file with all available libraries of the system and will return an expense, when possible * the service will parse the file with all available libraries of the system and will return an expense, when possible
* *
* @developer the function should be implemented with local first aproach to save costs of external providers (like mindee ocr)
*
* @return Expense * @return Expense
* @throws \Exception * @throws \Exception
*/ */
@ -41,7 +43,7 @@ class ParseEDocument extends AbstractService
/** @var \App\Models\Account $account */ /** @var \App\Models\Account $account */
$account = auth()->user()->account; $account = auth()->user()->account;
// try to parse via Zugferd lib // ZUGFERD - try to parse via Zugferd lib
$zugferd_exception = null; $zugferd_exception = null;
try { try {
switch (true) { switch (true) {
@ -56,7 +58,7 @@ class ParseEDocument extends AbstractService
$zugferd_exception = $e; $zugferd_exception = $e;
} }
// try to parse via mindee lib // MINDEE OCR - try to parse via mindee external service
$mindee_exception = null; $mindee_exception = null;
if (config('services.mindee.api_key') && (Ninja::isSelfHost() || (Ninja::isHosted() && $account->isPaid() && $account->plan == 'enterprise'))) if (config('services.mindee.api_key') && (Ninja::isSelfHost() || (Ninja::isHosted() && $account->isPaid() && $account->plan == 'enterprise')))
try { try {