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

View File

@ -62,7 +62,8 @@ class TriggeredActions extends AbstractService
private function sendEmail() 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){ $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; $client = $this->client;
//if the invoice //if the invoice
if($this->balance == 0){ if ($client->getSetting('enable_reminder1') !== false && $this->inReminderWindow(
return 'invoice';
}elseif ($client->getSetting('enable_reminder1') !== false && $this->inReminderWindow(
$client->getSetting('schedule_reminder1'), $client->getSetting('schedule_reminder1'),
$client->getSetting('num_days_reminder1') $client->getSetting('num_days_reminder1')
)) { )) {