Merge pull request #4452 from beganovich/v5-4450

(v5) Fix #4450 & apply php-cs-fixer
This commit is contained in:
Benjamin Beganović 2020-12-09 13:39:42 +01:00 committed by GitHub
commit a67de4ad7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 15 deletions

View File

@ -81,11 +81,13 @@ class SetupController extends Controller
}
try {
if ($request->mail_driver != 'log') {
$smtp = SystemHealth::testMailServer($request);
if ($smtp['success'] == false) {
throw new \Exception($smtp['message']);
}
}
} catch (\Exception $e) {
return response([
'message' => 'Oops, connection to mail server was not successful.',

View File

@ -34,8 +34,9 @@ class QueryLogging
$timeStart = microtime(true);
// Enable query logging for development
if (config('ninja.app_env') == 'production')
if (config('ninja.app_env') == 'production') {
return $next($request);
}
DB::enableQueryLog();

View File

@ -14,6 +14,7 @@ namespace App\Jobs\Ninja;
use App\DataMapper\InvoiceItem;
use App\Events\Invoice\InvoiceWasEmailed;
use App\Jobs\Entity\EmailEntity;
use App\Jobs\Util\WebHookHandler;
use App\Libraries\MultiDB;
use App\Models\Invoice;
use App\Models\Webhook;
@ -26,7 +27,6 @@ use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Carbon;
use App\Jobs\Util\WebHookHandler;
class SendReminders implements ShouldQueue
{

View File

@ -103,7 +103,7 @@ class Number
$value = number_format($value, $precision, $decimal, $thousand);
$symbol = $currency->symbol;
if ($client->getSetting('show_currency_code') === true && $currency->code == 'CHF'){
if ($client->getSetting('show_currency_code') === true && $currency->code == 'CHF') {
return "{$code} {$value}";
} elseif ($client->getSetting('show_currency_code') === true) {
return "{$value} {$code}";

View File

@ -602,15 +602,12 @@ trait GeneratesCounter
}
if ($entity instanceof Vendor) {
$search[] = '{$vendor_id_number}';
$replace[] = $entity->id_number;
}
if ($entity instanceof Expense) {
if($entity->vendor){
if ($entity->vendor) {
$search[] = '{$vendor_id_number}';
$replace[] = $entity->vendor->id_number;