1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

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

@ -844,7 +844,7 @@ class InvoiceController extends BaseController
$file_path = $invoice->service()->getInvoiceDeliveryNote($invoice, $invoice->invitations->first()->contact);
try {
$file = public_path("storage/{$file_path}");
$file = public_path("storage/{$file_path}");
return response()->download($file, basename($file));

View File

@ -69,7 +69,7 @@ class SetupController extends Controller
try {
$db = SystemHealth::dbCheck($request);
if ($db['success'] == false) {
throw new \Exception($db['message']);
}
@ -81,10 +81,12 @@ class SetupController extends Controller
}
try {
$smtp = SystemHealth::testMailServer($request);
if ($request->mail_driver != 'log') {
$smtp = SystemHealth::testMailServer($request);
if ($smtp['success'] == false) {
throw new \Exception($smtp['message']);
if ($smtp['success'] == false) {
throw new \Exception($smtp['message']);
}
}
} catch (\Exception $e) {
return response([

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

@ -343,7 +343,7 @@ class HtmlEngine
$data['$item'] = ['value' => '', 'label' => ctrans('texts.item')];
$data['$description'] = ['value' => '', 'label' => ctrans('texts.description')];
$data['$entity_footer'] = ['value' => $this->client->getSetting("{$this->entity_string}_footer"), 'label' => ''];
$data['$entity_footer'] = ['value' => $this->client->getSetting("{$this->entity_string}_footer"), 'label' => ''];
// $data['custom_label1'] = ['value' => '', 'label' => ctrans('texts.')];
// $data['custom_label2'] = ['value' => '', 'label' => ctrans('texts.')];

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;
@ -629,7 +626,7 @@ trait GeneratesCounter
$search[] = '{$expense_id_number}';
$replace[] = $entity->id_number;
}
}
if ($entity->client) {
$search[] = '{$client_custom1}';