Merge branch 'v5-develop' of https://github.com/turbo124/invoiceninja into v5-develop

This commit is contained in:
David Bomba 2021-08-28 08:01:17 +10:00
commit 7473f326c0
8 changed files with 23 additions and 8 deletions

View File

@ -72,6 +72,9 @@ class CompanyController extends BaseController
parent::__construct();
$this->company_repo = $company_repo;
// $this->middleware('password_protected')->only(['destroy']);
}
/**
@ -477,7 +480,7 @@ class CompanyController extends BaseController
*/
public function destroy(DestroyCompanyRequest $request, Company $company)
{
if(Ninja::isHosted() && config('ninja.ninja_default_company_id') == $company->id)
return response()->json(['message' => 'Cannot purge this company'], 400);

View File

@ -213,7 +213,7 @@ class PostMarkController extends BaseController
$request->input('MessageID')
);
LightLogs::create($bounce)->batch();
LightLogs::create($spam)->batch();
SystemLogger::dispatch($request->all(), SystemLog::CATEGORY_MAIL, SystemLog::EVENT_MAIL_SPAM_COMPLAINT, SystemLog::TYPE_WEBHOOK_RESPONSE, $this->invitation->contact->client, $this->invitation->company);
}

View File

@ -498,6 +498,7 @@ class CompanyExport implements ShouldQueue
if(Ninja::isHosted()) {
Storage::disk(config('filesystems.default'))->put('backups/'.$file_name, file_get_contents($zip_path));
unlink($zip_path);
}
App::forgetInstance('translator');

View File

@ -55,8 +55,8 @@ class QuoteWorkflowSettings implements ShouldQueue
});
}
if ($this->client->getSetting('auto_archive_quote')) {
$this->base_repository->archive($this->quote);
}
// if ($this->client->getSetting('auto_archive_quote')) {
// $this->base_repository->archive($this->quote);
// }
}
}

View File

@ -55,6 +55,10 @@ class SystemLogger implements ShouldQueue
MultiDB::setDb($this->company->db);
$client_id = $this->client ? $this->client->id : null;
if(!$this->client && !$this->company->owner())
return;
$user_id = $this->client ? $this->client->user_id : $this->company->owner()->id;
$sl = [

View File

@ -45,8 +45,8 @@ class SupportMessageSent extends Mailable
$log_file->seek(PHP_INT_MAX);
$last_line = $log_file->key();
$lines = new LimitIterator($log_file, $last_line - 100, $last_line);
$log_lines = iterator_to_array($lines);
}
@ -76,6 +76,7 @@ class SupportMessageSent extends Mailable
'system_info' => $system_info,
'laravel_log' => $log_lines,
'logo' => $company->present()->logo(),
'settings' => $company->settings
]);
}
}

View File

@ -81,8 +81,14 @@ class RefundPayment
if ($response['success'] == false) {
$this->payment->save();
throw new PaymentRefundFailed($response['description']);
if(array_key_exists('description', $response))
throw new PaymentRefundFailed($response['description']);
else
throw new PaymentRefundFailed();
}
}
} else {
$this->payment->refunded += $this->total_refund;

View File

@ -1,4 +1,4 @@
@component('email.template.admin', ['logo' => $logo ?? 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@component('email.template.admin', ['settings' => $settings, 'logo' => $logo ?? 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
{{-- Body --}}
{{ $support_message }}