mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 06:34:33 -04:00
Fixes for default quote/credit/invoice messages
This commit is contained in:
parent
5798efc0be
commit
6c7e150bec
@ -255,7 +255,7 @@ class BaseController extends Controller
|
|||||||
$query->where('expenses.user_id', $user->id)->orWhere('expenses.assigned_user_id', $user->id);
|
$query->where('expenses.user_id', $user->id)->orWhere('expenses.assigned_user_id', $user->id);
|
||||||
},
|
},
|
||||||
'company.groups' => function ($query) use ($updated_at, $user) {
|
'company.groups' => function ($query) use ($updated_at, $user) {
|
||||||
$query->where('updated_at', '>=', $updated_at)->with('documents');
|
$query->whereNotNull('updated_at')->with('documents');
|
||||||
|
|
||||||
// if(!$user->isAdmin())
|
// if(!$user->isAdmin())
|
||||||
// $query->where('group_settings.user_id', $user->id);
|
// $query->where('group_settings.user_id', $user->id);
|
||||||
@ -275,7 +275,7 @@ class BaseController extends Controller
|
|||||||
|
|
||||||
},
|
},
|
||||||
'company.payment_terms'=> function ($query) use ($updated_at, $user) {
|
'company.payment_terms'=> function ($query) use ($updated_at, $user) {
|
||||||
$query->where('updated_at', '>=', $updated_at);
|
$query->whereNotNull('updated_at');
|
||||||
|
|
||||||
if(!$user->isAdmin())
|
if(!$user->isAdmin())
|
||||||
$query->where('payment_terms.user_id', $user->id);
|
$query->where('payment_terms.user_id', $user->id);
|
||||||
@ -346,7 +346,6 @@ class BaseController extends Controller
|
|||||||
|
|
||||||
},
|
},
|
||||||
'company.subscriptions'=> function ($query) use($updated_at, $user) {
|
'company.subscriptions'=> function ($query) use($updated_at, $user) {
|
||||||
// $query->where('updated_at', '>=', $updated_at);
|
|
||||||
$query->whereNotNull('updated_at');
|
$query->whereNotNull('updated_at');
|
||||||
|
|
||||||
if(!$user->isAdmin())
|
if(!$user->isAdmin())
|
||||||
|
@ -69,6 +69,9 @@ class CreditEmailEngine extends BaseEmailEngine
|
|||||||
null,
|
null,
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$body_template .= '<div class="center">$view_button</div>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) {
|
if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) {
|
||||||
|
@ -74,6 +74,9 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
|||||||
null,
|
null,
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$body_template .= '<div class="center">$view_button</div>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) {
|
if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) {
|
||||||
|
@ -44,6 +44,7 @@ class QuoteEmailEngine extends BaseEmailEngine
|
|||||||
|
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
|
|
||||||
App::forgetInstance('translator');
|
App::forgetInstance('translator');
|
||||||
$t = app('translator');
|
$t = app('translator');
|
||||||
$t->replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
$t->replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
||||||
@ -56,9 +57,10 @@ class QuoteEmailEngine extends BaseEmailEngine
|
|||||||
} else {
|
} else {
|
||||||
$body_template = $this->client->getSetting('email_template_'.$this->reminder_template);
|
$body_template = $this->client->getSetting('email_template_'.$this->reminder_template);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use default translations if a custom message has not been set*/
|
/* Use default translations if a custom message has not been set*/
|
||||||
if (iconv_strlen($body_template) == 0) {
|
if (iconv_strlen($body_template) == 0) {
|
||||||
|
|
||||||
$body_template = trans(
|
$body_template = trans(
|
||||||
'texts.quote_message',
|
'texts.quote_message',
|
||||||
[
|
[
|
||||||
@ -69,8 +71,11 @@ class QuoteEmailEngine extends BaseEmailEngine
|
|||||||
null,
|
null,
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$body_template .= '<div class="center">$view_button</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) {
|
if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) {
|
||||||
$subject_template = $this->template_data['subject'];
|
$subject_template = $this->template_data['subject'];
|
||||||
} else {
|
} else {
|
||||||
|
@ -52,7 +52,8 @@ class TemplateEmail extends Mailable
|
|||||||
|
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
$template_name = 'email.template.'.$this->build_email->getTemplate();
|
|
||||||
|
$template_name = 'email.template.'.$this->build_email->getTemplate();
|
||||||
|
|
||||||
if ($this->build_email->getTemplate() == 'light' || $this->build_email->getTemplate() == 'dark') {
|
if ($this->build_email->getTemplate() == 'light' || $this->build_email->getTemplate() == 'dark') {
|
||||||
$template_name = 'email.template.client';
|
$template_name = 'email.template.client';
|
||||||
|
@ -59,9 +59,6 @@ class TriggeredActions extends AbstractService
|
|||||||
$reminder_template = $this->quote->calculateTemplate('quote');
|
$reminder_template = $this->quote->calculateTemplate('quote');
|
||||||
// $reminder_template = 'email_template_quote';
|
// $reminder_template = 'email_template_quote';
|
||||||
|
|
||||||
// nlog($reminder_template);
|
|
||||||
|
|
||||||
|
|
||||||
$this->quote->invitations->load('contact.client.country', 'quote.client.country', 'quote.company')->each(function ($invitation) use ($reminder_template) {
|
$this->quote->invitations->load('contact.client.country', 'quote.client.country', 'quote.company')->each(function ($invitation) use ($reminder_template) {
|
||||||
EmailEntity::dispatch($invitation, $this->quote->company, $reminder_template);
|
EmailEntity::dispatch($invitation, $this->quote->company, $reminder_template);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user