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(); parent::__construct();
$this->company_repo = $company_repo; $this->company_repo = $company_repo;
// $this->middleware('password_protected')->only(['destroy']);
} }
/** /**

View File

@ -213,7 +213,7 @@ class PostMarkController extends BaseController
$request->input('MessageID') $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); 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()) { if(Ninja::isHosted()) {
Storage::disk(config('filesystems.default'))->put('backups/'.$file_name, file_get_contents($zip_path)); Storage::disk(config('filesystems.default'))->put('backups/'.$file_name, file_get_contents($zip_path));
unlink($zip_path);
} }
App::forgetInstance('translator'); App::forgetInstance('translator');

View File

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

View File

@ -55,6 +55,10 @@ class SystemLogger implements ShouldQueue
MultiDB::setDb($this->company->db); MultiDB::setDb($this->company->db);
$client_id = $this->client ? $this->client->id : null; $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; $user_id = $this->client ? $this->client->user_id : $this->company->owner()->id;
$sl = [ $sl = [

View File

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

View File

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