diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php
index 7499b41d2d19..3024d424655a 100644
--- a/app/Console/Commands/CheckData.php
+++ b/app/Console/Commands/CheckData.php
@@ -355,8 +355,6 @@ class CheckData extends Command
$wrong_balances = 0;
$wrong_paid_to_dates = 0;
- //todo reversing an invoice breaks the check data at this point;
-
Client::cursor()->each(function ($client) use ($wrong_balances) {
$client->invoices->where('is_deleted', false)->each(function ($invoice) use ($wrong_balances, $client) {
$total_amount = $invoice->payments->sum('pivot.amount');
diff --git a/app/DataMapper/DefaultSettings.php b/app/DataMapper/DefaultSettings.php
index bfdcf155f28f..a80242697dbf 100644
--- a/app/DataMapper/DefaultSettings.php
+++ b/app/DataMapper/DefaultSettings.php
@@ -28,7 +28,6 @@ class DefaultSettings extends BaseSettings
/**
* @return stdClass
*
- * //todo user specific settings / preferences.
*/
public static function userSettings() : stdClass
{
diff --git a/app/Helpers/Email/EmailBuilder.php b/app/Helpers/Email/EmailBuilder.php
deleted file mode 100644
index f8be6203f104..000000000000
--- a/app/Helpers/Email/EmailBuilder.php
+++ /dev/null
@@ -1,173 +0,0 @@
-footer = $footer;
-
- return $this;
- }
-
- public function setVariables($variables)
- {
- $this->variables = $variables;
-
- return $this;
- }
-
- /**
- * @param $contact
- * @return $this
- */
- public function setContact($contact)
- {
- $this->contact = $contact;
-
- return $this;
- }
-
- /**
- * @param $subject
- * @return $this
- */
- public function setSubject($subject)
- {
-
- if (! empty($this->variables)) {
- $subject = str_replace(array_keys($this->variables), array_values($this->variables), $subject);
- }
-
- $this->subject = $subject;
-
- return $this;
- }
-
- /**
- * @param $body
- * @return $this
- */
- public function setBody($body)
- {
- //todo move this to use HTMLEngine
- if (! empty($this->variables)) {
- $body = str_replace(array_keys($this->variables), array_values($this->variables), $body);
- }
-
- $this->body = $body;
-
- return $this;
- }
-
- /**
- * @param $template_style
- * @return $this
- */
- public function setTemplate($template_style)
- {
- $this->template_style = $template_style;
-
- return $this;
- }
-
- public function setAttachments($attachments)
- {
- $this->attachments[] = $attachments;
-
- return $this;
- }
-
- public function setViewLink($link)
- {
- $this->view_link = $link;
-
- return $this;
- }
-
- public function setViewText($text)
- {
- $this->view_text = $text;
-
- return $this;
- }
-
- /**
- * @return mixed
- */
- public function getSubject()
- {
- return $this->subject;
- }
-
- /**
- * @return mixed
- */
- public function getBody()
- {
- return $this->body;
- }
-
- /**
- * @return mixed
- */
- public function getRecipients()
- {
- return $this->recipients;
- }
-
- /**
- * @return mixed
- */
- public function getAttachments()
- {
- return $this->attachments;
- }
-
- /**
- * @return mixed
- */
- public function getFooter()
- {
- return $this->footer;
- }
-
- /**
- * @return mixed
- */
- public function getTemplate()
- {
- return $this->template_style;
- }
-
- public function getViewLink()
- {
- return $this->view_link;
- }
-
- public function getViewText()
- {
- return $this->view_text;
- }
-}
diff --git a/app/Helpers/Email/InvoiceEmail.php b/app/Helpers/Email/InvoiceEmail.php
deleted file mode 100644
index 9fad11927ea8..000000000000
--- a/app/Helpers/Email/InvoiceEmail.php
+++ /dev/null
@@ -1,86 +0,0 @@
-contact->client;
- $invoice = $invitation->invoice;
- $contact = $invitation->contact;
-
- if (! $reminder_template) {
- $reminder_template = $invoice->calculateTemplate('invoice');
- }
-
- $body_template = $client->getSetting('email_template_'.$reminder_template);
-
- /* Use default translations if a custom message has not been set*/
- if (iconv_strlen($body_template) == 0) {
- $body_template = trans(
- 'texts.invoice_message',
- [
- 'invoice' => $invoice->number,
- 'company' => $invoice->company->present()->name(),
- 'amount' => Number::formatMoney($invoice->balance, $invoice->client),
- ],
- null,
- $invoice->client->locale()
- );
- }
-
- $subject_template = $client->getSetting('email_subject_'.$reminder_template);
-
- if (iconv_strlen($subject_template) == 0) {
- if ($reminder_template == 'quote') {
- $subject_template = trans(
- 'texts.quote_subject',
- [
- 'number' => $invoice->number,
- 'account' => $invoice->company->present()->name(),
- ],
- null,
- $invoice->client->locale()
- );
- } else {
- $subject_template = trans(
- 'texts.invoice_subject',
- [
- 'number' => $invoice->number,
- 'account' => $invoice->company->present()->name(),
- ],
- null,
- $invoice->client->locale()
- );
- }
- }
-
- $this->setTemplate($client->getSetting('email_style'))
- ->setContact($contact)
- ->setVariables((new HtmlEngine($invitation))->makeValues())
- ->setSubject($subject_template)
- ->setBody($body_template)
- ->setFooter("".ctrans('texts.view_invoice').'')
- ->setViewLink($invitation->getLink())
- ->setViewText(ctrans('texts.view_invoice'));
-
- if ($client->getSetting('pdf_email_attachment') !== false) {
- $this->setAttachments($invitation->pdf_file_path());
- }
-
- return $this;
- }
-}
diff --git a/app/Helpers/Email/PaymentEmail.php b/app/Helpers/Email/PaymentEmail.php
deleted file mode 100644
index 0e96d2dc35f7..000000000000
--- a/app/Helpers/Email/PaymentEmail.php
+++ /dev/null
@@ -1,48 +0,0 @@
-client;
-
- $body_template = $client->getSetting('email_template_payment');
-
- /* Use default translations if a custom message has not been set*/
- if (iconv_strlen($body_template) == 0) {
- $body_template = trans(
- 'texts.payment_message',
- ['amount' => $payment->amount, 'company' => $payment->company->present()->name()],
- null,
- $this->client->locale()
- );
- }
-
- $subject_template = $client->getSetting('email_subject_payment');
-
- if (iconv_strlen($subject_template) == 0) {
- $subject_template = trans(
- 'texts.payment_subject',
- ['number' => $payment->number, 'company' => $payment->company->present()->name()],
- null,
- $payment->client->locale()
- );
- }
-
- $this->setTemplate($payment->client->getSetting('email_style'))
- ->setSubject($subject_template)
- ->setBody($body_template);
-
- return $this;
- }
-}
diff --git a/app/Helpers/Email/QuoteEmail.php b/app/Helpers/Email/QuoteEmail.php
deleted file mode 100644
index c98f1d0532f3..000000000000
--- a/app/Helpers/Email/QuoteEmail.php
+++ /dev/null
@@ -1,70 +0,0 @@
-contact->client;
- $quote = $invitation->quote;
- $contact = $invitation->contact;
-
- $this->template_style = $client->getSetting('email_style');
-
- $body_template = $client->getSetting('email_template_'.$reminder_template);
-
- /* Use default translations if a custom message has not been set*/
- if (iconv_strlen($body_template) == 0) {
- $body_template = trans(
- 'texts.quote_message',
- ['amount' => $quote->amount, 'company' => $quote->company->present()->name()],
- null,
- $quote->client->locale()
- );
- }
-
- $subject_template = $client->getSetting('email_subject_'.$reminder_template);
-
- if (iconv_strlen($subject_template) == 0) {
- if ($reminder_template == 'quote') {
- $subject_template = trans(
- 'texts.quote_subject',
- ['number' => $quote->number, 'company' => $quote->company->present()->name()],
- null,
- $quote->client->locale()
- );
- } else {
- $subject_template = trans(
- 'texts.reminder_subject',
- ['number' => $quote->number, 'company' => $quote->company->present()->name()],
- null,
- $quote->client->locale()
- );
- }
- }
-
- $this->setTemplate($quote->client->getSetting('email_style'))
- ->setContact($contact)
- ->setFooter("Quote Link")
- ->setVariables((new HtmlEngine($invitation))->makeValues())
- ->setSubject($subject_template)
- ->setBody($body_template);
-
- if ($client->getSetting('pdf_email_attachment') !== false) {
- $this->attachments = $invitation->pdf_file_path();
- }
-
- return $this;
- }
-}
diff --git a/app/Helpers/Mail/GmailTransport.php b/app/Helpers/Mail/GmailTransport.php
index b183cbaf2820..90377b16b37e 100644
--- a/app/Helpers/Mail/GmailTransport.php
+++ b/app/Helpers/Mail/GmailTransport.php
@@ -63,7 +63,7 @@ class GmailTransport extends Transport
$this->gmail->cc($message->getCc());
$this->gmail->bcc($message->getBcc());
- Log::error(print_r($message->getChildren(), 1));
+ info(print_r($message->getChildren(), 1));
foreach ($message->getChildren() as $child) {
$this->gmail->attach($child);
diff --git a/app/Helpers/TranslationHelper.php b/app/Helpers/TranslationHelper.php
index 76a582645894..6fdf3f8236f2 100644
--- a/app/Helpers/TranslationHelper.php
+++ b/app/Helpers/TranslationHelper.php
@@ -23,6 +23,8 @@
function ctrans(string $string, $replace = [], $locale = null) : string
{
//todo pass through the cached version of the custom strings here else return trans();
+ //note** This may no longer be required as we are injecting the custom translations
+ //into the singleton now?
return trans($string, $replace, $locale);
}
diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php
index 301929ddb0d6..4ad02907e345 100644
--- a/app/Jobs/Util/ReminderJob.php
+++ b/app/Jobs/Util/ReminderJob.php
@@ -12,7 +12,6 @@
namespace App\Jobs\Util;
use App\Events\Invoice\InvoiceWasEmailed;
-use App\Helpers\Email\InvoiceEmail;
use App\Jobs\Invoice\EmailInvoice;
use App\Libraries\MultiDB;
use App\Models\Account;
diff --git a/app/Jobs/Util/SendFailedEmails.php b/app/Jobs/Util/SendFailedEmails.php
index 2e04c5d80b97..19281c19a1e7 100644
--- a/app/Jobs/Util/SendFailedEmails.php
+++ b/app/Jobs/Util/SendFailedEmails.php
@@ -11,7 +11,6 @@
namespace App\Jobs\Util;
-use App\Helpers\Email\InvoiceEmail;
use App\Jobs\Entity\EmailEntity;
use App\Libraries\MultiDB;
use App\Models\SystemLog;
diff --git a/app/Services/Payment/UpdateInvoicePayment.php b/app/Services/Payment/UpdateInvoicePayment.php
index 341e3c746595..31643652ba2f 100644
--- a/app/Services/Payment/UpdateInvoicePayment.php
+++ b/app/Services/Payment/UpdateInvoicePayment.php
@@ -12,7 +12,6 @@
namespace App\Services\Payment;
use App\Events\Invoice\InvoiceWasUpdated;
-use App\Helpers\Email\PaymentEmail;
use App\Jobs\Payment\EmailPayment;
use App\Jobs\Util\SystemLogger;
use App\Models\Invoice;
diff --git a/app/Services/Quote/SendEmail.php b/app/Services/Quote/SendEmail.php
index f2382567b92e..ae42c3b7ad81 100644
--- a/app/Services/Quote/SendEmail.php
+++ b/app/Services/Quote/SendEmail.php
@@ -11,7 +11,6 @@
namespace App\Services\Quote;
-use App\Helpers\Email\QuoteEmail;
use App\Jobs\Entity\EmailEntity;
use App\Jobs\Quote\EmailQuote;
use App\Models\ClientContact;
@@ -46,9 +45,6 @@ class SendEmail
$this->quote->invitations->each(function ($invitation) {
if ($invitation->contact->send_email && $invitation->contact->email) {
- $email_builder = (new QuoteEmail())->build($invitation, $this->reminder_template);
-
- // EmailQuote::dispatchNow($email_builder, $invitation, $invitation->company);
EmailEntity::dispatchNow($invitation, $invitation->company, $this->reminder_template);
}