Fix for paid invoice emails

This commit is contained in:
David Bomba 2020-07-15 17:03:35 +10:00
parent 018340cd03
commit cab6f313fe
3 changed files with 7 additions and 8 deletions

View File

@ -45,9 +45,9 @@ class InvoiceEmail extends EmailBuilder
if (iconv_strlen($subject_template) == 0) {
if ($reminder_template == 'quote') {
$subject_template = trans(
'texts.invoice_subject',
'texts.quote_subject',
[
'invoice' => $invoice->present()->invoice_number(),
'number' => $invoice->number,
'account' => $invoice->company->present()->name()
],
null,
@ -55,9 +55,9 @@ class InvoiceEmail extends EmailBuilder
);
} else {
$subject_template = trans(
'texts.reminder_subject',
'texts.invoice_subject',
[
'invoice' => $invoice->present()->invoice_number(),
'number' => $invoice->number,
'account' => $invoice->company->present()->name()
],
null,

View File

@ -62,7 +62,8 @@ class TriggeredActions extends AbstractService
private function sendEmail()
{
$reminder_template = $this->invoice->calculateTemplate();
//$reminder_template = $this->invoice->calculateTemplate();
$reminder_template = 'payment';
$this->invoice->invitations->load('contact.client.country','invoice.client.country','invoice.company')->each(function ($invitation) use($reminder_template){

View File

@ -189,9 +189,7 @@ trait MakesReminders
$client = $this->client;
//if the invoice
if($this->balance == 0){
return 'invoice';
}elseif ($client->getSetting('enable_reminder1') !== false && $this->inReminderWindow(
if ($client->getSetting('enable_reminder1') !== false && $this->inReminderWindow(
$client->getSetting('schedule_reminder1'),
$client->getSetting('num_days_reminder1')
)) {