mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Additional checks for exchange rates
This commit is contained in:
parent
a9004fa9f7
commit
6ef7d5ec6a
@ -13,6 +13,7 @@ namespace App\Utils;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Mail\TestMailServer;
|
||||
use App\Models\Company;
|
||||
use Exception;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@ -82,9 +83,34 @@ class SystemHealth
|
||||
'queue' => (string) config('queue.default'),
|
||||
'trailing_slash' => (bool) self::checkUrlState(),
|
||||
'file_permissions' => (string) self::checkFileSystem(),
|
||||
'exchange_rate_api_not_configured' => (bool)self::checkCurrencySanity(),
|
||||
];
|
||||
}
|
||||
|
||||
private static function checkCurrencySanity()
|
||||
{
|
||||
|
||||
if(strlen(config('ninja.currency_converter_api_key')) == 0){
|
||||
|
||||
$cs = DB::table('clients')
|
||||
->select('settings->currency_id as id')
|
||||
->get();
|
||||
|
||||
|
||||
$currency_count = $cs->unique('id')->filter(function ($value){
|
||||
return !is_null($value->id);
|
||||
})->count();
|
||||
|
||||
|
||||
if($currency_count > 1)
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
private static function checkQueueSize()
|
||||
{
|
||||
$count = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user