Merge pull request #7398 from turbo124/v5-develop

v5.3.84
This commit is contained in:
David Bomba 2022-04-27 09:45:15 +10:00 committed by GitHub
commit f467b32730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 44 additions and 9 deletions

View File

@ -1 +1 @@
5.3.83 5.3.84

View File

@ -271,8 +271,10 @@ class CompanySettings extends BaseSettings
public $use_credits_payment = 'off'; //always, option, off //@implemented public $use_credits_payment = 'off'; //always, option, off //@implemented
public $hide_empty_columns_on_pdf = false; public $hide_empty_columns_on_pdf = false;
public $email_from_name = ''; public $email_from_name = '';
public $auto_archive_invoice_cancelled = false;
public static $casts = [ public static $casts = [
'auto_archive_invoice_cancelled' => 'bool',
'email_from_name' => 'string', 'email_from_name' => 'string',
'show_all_tasks_client_portal' => 'string', 'show_all_tasks_client_portal' => 'string',
'entity_send_time' => 'int', 'entity_send_time' => 'int',

View File

@ -107,6 +107,8 @@ class ClientController extends BaseController
*/ */
public function index(ClientFilters $filters) public function index(ClientFilters $filters)
{ {
set_time_limit(45);
$clients = Client::filter($filters); $clients = Client::filter($filters);
return $this->listResponse($clients); return $this->listResponse($clients);

View File

@ -119,6 +119,8 @@ class InvoiceController extends BaseController
*/ */
public function index(InvoiceFilters $filters) public function index(InvoiceFilters $filters)
{ {
set_time_limit(45);
$invoices = Invoice::filter($filters); $invoices = Invoice::filter($filters);
return $this->listResponse($invoices); return $this->listResponse($invoices);

View File

@ -111,6 +111,7 @@ class SelfUpdateController extends BaseController
} }
$this->testWritable(); $this->testWritable();
$this->clearCacheDir();
copy($this->getDownloadUrl(), storage_path('app/invoiceninja.zip')); copy($this->getDownloadUrl(), storage_path('app/invoiceninja.zip'));
@ -158,6 +159,19 @@ class SelfUpdateController extends BaseController
} }
} }
private function clearCacheDir()
{
$directoryIterator = new \RecursiveDirectoryIterator(base_path('bootstrap/cache'), \RecursiveDirectoryIterator::SKIP_DOTS);
foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
unlink(base_path('bootstrap/cache/').$file->getFileName());
}
}
private function testWritable() private function testWritable()
{ {
$directoryIterator = new \RecursiveDirectoryIterator(base_path(), \RecursiveDirectoryIterator::SKIP_DOTS); $directoryIterator = new \RecursiveDirectoryIterator(base_path(), \RecursiveDirectoryIterator::SKIP_DOTS);

View File

@ -569,8 +569,6 @@ class BaseImport
'company' => $this->company, 'company' => $this->company,
]; ];
nlog($this->company->company_users);
$nmo = new NinjaMailerObject; $nmo = new NinjaMailerObject;
$nmo->mailable = new ImportCompleted($this->company, $data); $nmo->mailable = new ImportCompleted($this->company, $data);
$nmo->company = $this->company; $nmo->company = $this->company;

View File

@ -30,7 +30,8 @@ class SupportMessageSent extends Mailable
*/ */
public function build() public function build()
{ {
$system_info = null; $system_info = request()->has('version') ? 'Version: '.request()->input('version') : 'Version: No Version Supplied.';
$log_lines = []; $log_lines = [];
/* /*

View File

@ -159,7 +159,7 @@ class Gateway extends StaticModel
break; break;
case 52: case 52:
return [ return [
GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => [' ']], // GoCardless GatewayType::BANK_TRANSFER => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']], // GoCardless
GatewayType::DIRECT_DEBIT => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']], GatewayType::DIRECT_DEBIT => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
GatewayType::SEPA => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']], GatewayType::SEPA => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
GatewayType::INSTANT_BANK_PAY => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']], GatewayType::INSTANT_BANK_PAY => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],

View File

@ -186,7 +186,7 @@ class PaymentRepository extends BaseRepository {
TransactionLog::dispatch(TransactionEvent::PAYMENT_MADE, $transaction, $payment->company->db); TransactionLog::dispatch(TransactionEvent::PAYMENT_MADE, $transaction, $payment->company->db);
return $payment->fresh(); return $payment->refresh();
} }
/** /**

View File

@ -52,6 +52,8 @@ class HandleCancellation extends AbstractService
//adjust client balance //adjust client balance
$this->invoice->client->service()->updateBalance($adjustment)->save(); $this->invoice->client->service()->updateBalance($adjustment)->save();
$this->invoice->service()->workFlow()->save();
event(new InvoiceWasCancelled($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); event(new InvoiceWasCancelled($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
$transaction = [ $transaction = [

View File

@ -546,6 +546,19 @@ class InvoiceService
event(new InvoiceWasArchived($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); event(new InvoiceWasArchived($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
}
if ($this->invoice->status_id == Invoice::STATUS_CANCELLED && $this->invoice->client->getSetting('auto_archive_invoice_cancelled')) {
/* Throws: Payment amount xxx does not match invoice totals. */
if ($this->invoice->trashed())
return $this;
$this->invoice->delete();
event(new InvoiceWasArchived($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
} }
return $this; return $this;

View File

@ -48,7 +48,8 @@ class Ninja
'White Label: '.'\\n'. // TODO: Implement white label with hasFeature. 'White Label: '.'\\n'. // TODO: Implement white label with hasFeature.
'Server OS: '.php_uname('s').' '.php_uname('r').'\\n'. 'Server OS: '.php_uname('s').' '.php_uname('r').'\\n'.
'PHP Version: '.phpversion().'\\n'. 'PHP Version: '.phpversion().'\\n'.
'MySQL Version: '.$mysql_version; 'MySQL Version: '.$mysql_version.'\\n'.
'Version: '. request()->has('version') ? request()->input('version') : 'No Version Supplied.';
return $info; return $info;
} }

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.3.83', 'app_version' => '5.3.84',
'app_tag' => '5.3.83', 'app_tag' => '5.3.84',
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),