diff --git a/app/Http/Controllers/PreviewController.php b/app/Http/Controllers/PreviewController.php index 43b6f34d854d..ba7f127cded3 100644 --- a/app/Http/Controllers/PreviewController.php +++ b/app/Http/Controllers/PreviewController.php @@ -145,6 +145,7 @@ class PreviewController extends BaseController ]); $invoice->setRelation('client', $client); + $invoice->setRelation('company', auth()->user()->company()); $invoice->load('client'); $invoice_design = new Custom((object)request()->input('body')); diff --git a/app/Notifications/Admin/EntityViewedNotification.php b/app/Notifications/Admin/EntityViewedNotification.php index b1cfc2207961..b1db215fe9bd 100644 --- a/app/Notifications/Admin/EntityViewedNotification.php +++ b/app/Notifications/Admin/EntityViewedNotification.php @@ -42,6 +42,8 @@ class EntityViewedNotification extends Notification implements ShouldQueue $this->company = $invitation->company; $this->settings = $this->entity->client->getMergedSettings(); $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); $data = [ - 'title' => $subject, + 'title' => $this->buildSubject(), 'message' => ctrans("texts.notification_{$this->entity_name}_viewed", [ 'amount' => $amount, diff --git a/app/Transformers/ClientContactTransformer.php b/app/Transformers/ClientContactTransformer.php index 572276c56ca3..e6dcb0812c15 100644 --- a/app/Transformers/ClientContactTransformer.php +++ b/app/Transformers/ClientContactTransformer.php @@ -47,7 +47,7 @@ class ClientContactTransformer extends EntityTransformer 'contact_key' => $contact->contact_key ?: '', 'send_email' => (bool) $contact->send_email, 'last_login' => (int)$contact->last_login, - 'password' => isset($contact->password) ? '*****' : '', + 'password' => empty($contact->password) ? '' : '**********', ]; } } diff --git a/app/Utils/Traits/SettingsSaver.php b/app/Utils/Traits/SettingsSaver.php index f05f8469559f..fb901583d386 100644 --- a/app/Utils/Traits/SettingsSaver.php +++ b/app/Utils/Traits/SettingsSaver.php @@ -66,6 +66,9 @@ trait SettingsSaver $settings = (object)$settings; $casts = CompanySettings::$casts; + if(property_exists($settings, 'pdf_variables')) + unset($settings->pdf_variables); + ksort($casts); foreach ($casts as $key => $value) {