Improvements for comparisons

This commit is contained in:
David Bomba
2026-02-25 14:22:35 +11:00
parent 2da717c95b
commit 75016bb825
7 changed files with 313 additions and 469 deletions

View File

@@ -88,7 +88,7 @@ class MindeeEDocument extends AbstractService
/** @var \App\Models\Currency $currency */
$currency = app('currencies')->first(function ($c) use ($invoiceCurrency) {
/** @var \App\Models\Currency $c */
return $c->code == $invoiceCurrency;
return $c->code == strtoupper($invoiceCurrency);
});
$expense = ExpenseFactory::create($this->company->id, $this->company->owner()->id);

View File

@@ -138,7 +138,7 @@ class ZugferdEDocument extends AbstractService
$country = app('countries')->first(function ($c) use ($country) {
/** @var \App\Models\Country $c */
return $c->iso_3166_2 == $country || $c->iso_3166_3 == $country;
return $c->iso_3166_2 == strtoupper($country) || $c->iso_3166_3 == strtoupper($country);
});
if ($country) {
$vendor->country_id = $country->id;

View File

@@ -42,7 +42,7 @@ class BaseTransformer
$currency = app('currencies')->first(function ($c) use ($currency_code) {
/** @var \App\Models\Currency $c */
return $c->code == $currency_code;
return $c->code == strtoupper($currency_code);
});
return $currency ? (string) $currency->id : $this->company->settings->currency_id;

View File

@@ -118,8 +118,7 @@
"twig/twig": "^3.14",
"twilio/sdk": "^6.40",
"wikimedia/composer-merge-plugin": "^2.1",
"wildbit/postmark-php": "^4.0",
"invoiceninja/admin-api": "dev-main"
"wildbit/postmark-php": "^4.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.6",
@@ -224,10 +223,6 @@
{
"type": "vcs",
"url": "https://github.com/turbo124/snappdf"
},
{
"type": "path",
"url": "../admin-api"
}
],
"minimum-stability": "dev",

766
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -155,5 +155,6 @@ class Preloader
\Laravel\Octane\Tables\OpenSwooleTable::class,
\Laravel\Octane\Tables\SwooleTable::class,
\Laravel\Octane\WorkerExceptionInspector::class,
\Sabberworm\CSS\Rule\Rule::class
)
->load();

View File

@@ -297,7 +297,7 @@ class StorecoveIngestTest extends TestCase
}
$currency = app('currencies')->first(function ($c) use ($storecove_invoice) {
return $storecove_invoice->getDocumentCurrencyCode() == $c->iso_3166_3;
return $storecove_invoice->getDocumentCurrencyCode() == strtoupper($c->iso_3166_3);
})->id ?? 1;
//vendor