Fixes for notifications (#3427)

* Fix for pdf_variables

* Fixes for notification
This commit is contained in:
David Bomba 2020-03-05 19:36:52 +11:00 committed by GitHub
parent 804153b049
commit ff5a850e8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -145,6 +145,7 @@ class PreviewController extends BaseController
]); ]);
$invoice->setRelation('client', $client); $invoice->setRelation('client', $client);
$invoice->setRelation('company', auth()->user()->company());
$invoice->load('client'); $invoice->load('client');
$invoice_design = new Custom((object)request()->input('body')); $invoice_design = new Custom((object)request()->input('body'));

View File

@ -42,6 +42,8 @@ class EntityViewedNotification extends Notification implements ShouldQueue
$this->company = $invitation->company; $this->company = $invitation->company;
$this->settings = $this->entity->client->getMergedSettings(); $this->settings = $this->entity->client->getMergedSettings();
$this->is_system = $is_system; $this->is_system = $is_system;
$this->invitation = $invitation;
} }
/** /**
@ -128,7 +130,7 @@ class EntityViewedNotification extends Notification implements ShouldQueue
$amount = Number::formatMoney($this->entity->amount, $this->entity->client); $amount = Number::formatMoney($this->entity->amount, $this->entity->client);
$data = [ $data = [
'title' => $subject, 'title' => $this->buildSubject(),
'message' => ctrans("texts.notification_{$this->entity_name}_viewed", 'message' => ctrans("texts.notification_{$this->entity_name}_viewed",
[ [
'amount' => $amount, 'amount' => $amount,

View File

@ -47,7 +47,7 @@ class ClientContactTransformer extends EntityTransformer
'contact_key' => $contact->contact_key ?: '', 'contact_key' => $contact->contact_key ?: '',
'send_email' => (bool) $contact->send_email, 'send_email' => (bool) $contact->send_email,
'last_login' => (int)$contact->last_login, 'last_login' => (int)$contact->last_login,
'password' => isset($contact->password) ? '*****' : '', 'password' => empty($contact->password) ? '' : '**********',
]; ];
} }
} }

View File

@ -66,6 +66,9 @@ trait SettingsSaver
$settings = (object)$settings; $settings = (object)$settings;
$casts = CompanySettings::$casts; $casts = CompanySettings::$casts;
if(property_exists($settings, 'pdf_variables'))
unset($settings->pdf_variables);
ksort($casts); ksort($casts);
foreach ($casts as $key => $value) { foreach ($casts as $key => $value) {