fix: mindee taxation transform issue

This commit is contained in:
paulwer 2024-09-16 06:57:02 +02:00
parent 5c0f228cb7
commit 3f0f5663a9
3 changed files with 13 additions and 16 deletions

View File

@ -273,8 +273,6 @@ class PostMarkController extends BaseController
$input = $request->all();
nlog($input);
if (!$request->has('token') || $request->token != config('ninja.inbound_mailbox.inbound_webhook_token'))
return response()->json(['message' => 'Unauthorized'], 403);

View File

@ -83,7 +83,7 @@ class MindeeEDocument extends AbstractService
// Handle accordingly
/** @var \App\Models\Currency $currency */
$currency = app('currencies')->first(function ($c) use ($invoiceCurrency){
$currency = app('currencies')->first(function ($c) use ($invoiceCurrency) {
/** @var \App\Models\Currency $c */
return $c->code == $invoiceCurrency;
});
@ -105,7 +105,7 @@ class MindeeEDocument extends AbstractService
$counter = 1;
foreach ($prediction->taxes as $taxesElem) {
$expense->{"tax_amount{$counter}"} = $taxesElem->amount;
$expense->{"tax_amount{$counter}"} = $taxesElem->value;
$expense->{"tax_rate{$counter}"} = $taxesElem->rate;
$counter++;
}

View File

@ -57,7 +57,6 @@ class ParseEDocument extends AbstractService
try {
return (new ZugferdEDocument($this->file, $this->company))->run();
} catch (Exception $e) {
nlog($this->file->get());
nlog("Zugferd Exception: " . $e->getMessage());
}
}