From de0e1d9bc644506f616ccba9e817f3e290ba2ce6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 6 Aug 2021 07:21:40 +1000 Subject: [PATCH] Fixes for missing documents --- app/Jobs/Util/Import.php | 3 ++- app/Mail/Engine/PaymentEmailEngine.php | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index 7b01cc890c18..416847cac797 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -1297,7 +1297,8 @@ class Import implements ShouldQueue } if(!$entity) - throw new Exception("Resource invoice/quote document not available."); + continue; + // throw new Exception("Resource invoice/quote document not available."); } diff --git a/app/Mail/Engine/PaymentEmailEngine.php b/app/Mail/Engine/PaymentEmailEngine.php index d008f38f0bd1..904052d9b8c8 100644 --- a/app/Mail/Engine/PaymentEmailEngine.php +++ b/app/Mail/Engine/PaymentEmailEngine.php @@ -133,6 +133,7 @@ class PaymentEmailEngine extends BaseEmailEngine $data['$email'] = ['value' => isset($this->contact) ? $this->contact->email : 'no contact email on record', 'label' => ctrans('texts.email')]; $data['$client_name'] = ['value' => $this->client->present()->name() ?: ' ', 'label' => ctrans('texts.client_name')]; $data['$client.name'] = &$data['$client_name']; + $data['$client'] = &$data['$client_name']; $data['$client.address1'] = &$data['$address1']; $data['$client.address2'] = &$data['$address2']; $data['$client_address'] = ['value' => $this->client->present()->address() ?: ' ', 'label' => ctrans('texts.address')]; @@ -164,6 +165,7 @@ class PaymentEmailEngine extends BaseEmailEngine $data['$contact.custom2'] = ['value' => isset($this->contact) ? $this->contact->custom_value2 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')]; $data['$contact.custom3'] = ['value' => isset($this->contact) ? $this->contact->custom_value3 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')]; $data['$contact.custom4'] = ['value' => isset($this->contact) ? $this->contact->custom_value4 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')]; + $data['$firstName'] = &$data['$contact.first_name']; $data['$company.city_state_postal'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, false) ?: ' ', 'label' => ctrans('texts.city_state_postal')]; $data['$company.postal_city_state'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city_state')]; @@ -191,7 +193,11 @@ class PaymentEmailEngine extends BaseEmailEngine $data['$company4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company4', $this->settings->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company4')]; $data['$view_link'] = ['value' => ''.ctrans('texts.view_payment').'', 'label' => ctrans('texts.view_payment')]; + $data['$paymentLink'] = &$data['$view_link']; + $data['$portalButton'] = &$data['$view_link']; + $data['$view_url'] = ['value' => $this->payment->getLink(), 'label' => ctrans('texts.view_payment')]; + $data['$signature'] = ['value' => $this->settings->email_signature ?: ' ', 'label' => '']; $data['$invoices'] = ['value' => $this->formatInvoices(), 'label' => ctrans('texts.invoices')];