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

Merge pull request #7388 from turbo124/v5-develop

Minor fixes
This commit is contained in:
David Bomba 2022-04-24 18:52:05 +10:00 committed by GitHub
commit d9c6054c78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 268 additions and 246 deletions

View File

@ -134,7 +134,7 @@ class TypeCheck extends Command
$this->logMessage(date('Y-m-d h:i:s').' Checking all clients and companies.'); $this->logMessage(date('Y-m-d h:i:s').' Checking all clients and companies.');
Client::cursor()->each( function ($client) { Client::withTrashed()->cursor()->each( function ($client) {
$this->logMessage("Checking client {$client->id}"); $this->logMessage("Checking client {$client->id}");
$entity_settings = $this->checkSettingType($client->settings); $entity_settings = $this->checkSettingType($client->settings);
$entity_settings->md5 = md5(time()); $entity_settings->md5 = md5(time());

View File

@ -50,6 +50,8 @@ class RecurringInvoiceFactory
$invoice->next_send_date = null; $invoice->next_send_date = null;
$invoice->remaining_cycles = -1; $invoice->remaining_cycles = -1;
$invoice->paid_to_date = 0; $invoice->paid_to_date = 0;
$invoice->auto_bill_enabled = false;
$invoice->auto_bill = 'off';
return $invoice; return $invoice;
} }

View File

@ -57,10 +57,13 @@ class ClientFilters extends QueryFilters
{ {
$parts = explode(':', $balance); $parts = explode(':', $balance);
if(!is_array($parts))
return $this->builder;
return $this->builder->whereBetween('balance', [$parts[0], $parts[1]]); return $this->builder->whereBetween('balance', [$parts[0], $parts[1]]);
} }
public function email(string $email):Builder public function email(string $email = ''):Builder
{ {
return return

View File

@ -97,6 +97,7 @@ class PreviewController extends BaseController
! empty(request()->input('entity')) && ! empty(request()->input('entity')) &&
! empty(request()->input('entity_id')) && ! empty(request()->input('entity_id')) &&
request()->has('body')) { request()->has('body')) {
$design_object = json_decode(json_encode(request()->input('design'))); $design_object = json_decode(json_encode(request()->input('design')));
if (! is_object($design_object)) { if (! is_object($design_object)) {

View File

@ -12,7 +12,9 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Exceptions\FilePermissionsFailure; use App\Exceptions\FilePermissionsFailure;
use App\Models\Client;
use App\Utils\Ninja; use App\Utils\Ninja;
use App\Utils\Traits\ClientGroupSettingsSaver;
use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
@ -20,6 +22,7 @@ use Illuminate\Support\Facades\Storage;
class SelfUpdateController extends BaseController class SelfUpdateController extends BaseController
{ {
use DispatchesJobs; use DispatchesJobs;
use ClientGroupSettingsSaver;
private array $purge_file_list = [ private array $purge_file_list = [
'bootstrap/cache/compiled.php', 'bootstrap/cache/compiled.php',
@ -141,6 +144,20 @@ class SelfUpdateController extends BaseController
} }
private function postHookUpdate()
{
if(config('ninja.app_version') == '5.3.82')
{
Client::withTrashed()->cursor()->each( function ($client) {
$entity_settings = $this->checkSettingType($client->settings);
$entity_settings->md5 = md5(time());
$client->settings = $entity_settings;
$client->save();
});
}
}
private function testWritable() private function testWritable()
{ {
$directoryIterator = new \RecursiveDirectoryIterator(base_path(), \RecursiveDirectoryIterator::SKIP_DOTS); $directoryIterator = new \RecursiveDirectoryIterator(base_path(), \RecursiveDirectoryIterator::SKIP_DOTS);

484
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ class ClientSettingsParseForTypes extends Migration
if(Ninja::isSelfHost()) if(Ninja::isSelfHost())
{ {
Client::cursor()->each( function ($client) { Client::withTrashed()->cursor()->each( function ($client) {
$entity_settings = $this->checkSettingType($client->settings); $entity_settings = $this->checkSettingType($client->settings);
$entity_settings->md5 = md5(time()); $entity_settings->md5 = md5(time());
$client->settings = $entity_settings; $client->settings = $entity_settings;
@ -31,7 +31,6 @@ class ClientSettingsParseForTypes extends Migration
}); });
} }
} }