mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for recurring invoices where auto_email_invoice not set
This commit is contained in:
parent
a4da2b0428
commit
5af0ad72e9
@ -112,6 +112,9 @@ class EmailEntity implements ShouldQueue
|
|||||||
App::setLocale($this->invitation->contact->preferredLocale());
|
App::setLocale($this->invitation->contact->preferredLocale());
|
||||||
$t->replace(Ninja::transformTranslations($this->settings));
|
$t->replace(Ninja::transformTranslations($this->settings));
|
||||||
|
|
||||||
|
/* Mark entity sent */
|
||||||
|
$this->entity->service()->markSent()->save();
|
||||||
|
|
||||||
$nmo = new NinjaMailerObject;
|
$nmo = new NinjaMailerObject;
|
||||||
$nmo->mailable = new TemplateEmail($this->email_entity_builder, $this->invitation->contact, $this->invitation);
|
$nmo->mailable = new TemplateEmail($this->email_entity_builder, $this->invitation->contact, $this->invitation);
|
||||||
$nmo->company = $this->company;
|
$nmo->company = $this->company;
|
||||||
@ -124,8 +127,7 @@ class EmailEntity implements ShouldQueue
|
|||||||
|
|
||||||
NinjaMailerJob::dispatchNow($nmo);
|
NinjaMailerJob::dispatchNow($nmo);
|
||||||
|
|
||||||
/* Mark entity sent */
|
|
||||||
$this->entity->service()->markSent()->save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function resolveEntityString() :string
|
private function resolveEntityString() :string
|
||||||
|
@ -64,7 +64,7 @@ class QuoteEmailEngine extends BaseEmailEngine
|
|||||||
[
|
[
|
||||||
'quote' => $this->quote->number,
|
'quote' => $this->quote->number,
|
||||||
'company' => $this->quote->company->present()->name(),
|
'company' => $this->quote->company->present()->name(),
|
||||||
'amount' => Number::formatMoney($this->quote->balance, $this->client),
|
'amount' => Number::formatMoney($this->quote->amount, $this->client),
|
||||||
],
|
],
|
||||||
null,
|
null,
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
@ -99,7 +99,6 @@ class QuoteEmailEngine extends BaseEmailEngine
|
|||||||
->setViewText(ctrans('texts.view_quote'))
|
->setViewText(ctrans('texts.view_quote'))
|
||||||
->setInvitation($this->invitation);
|
->setInvitation($this->invitation);
|
||||||
|
|
||||||
|
|
||||||
if ($this->client->getSetting('pdf_email_attachment') !== false && $this->quote->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
|
if ($this->client->getSetting('pdf_email_attachment') !== false && $this->quote->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
|
||||||
|
|
||||||
if(Ninja::isHosted())
|
if(Ninja::isHosted())
|
||||||
|
@ -483,6 +483,10 @@ class InvoiceService
|
|||||||
if(!isset($this->invoice->exchange_rate) && $this->invoice->client->currency()->id != (int) $this->invoice->company->settings->currency_id)
|
if(!isset($this->invoice->exchange_rate) && $this->invoice->client->currency()->id != (int) $this->invoice->company->settings->currency_id)
|
||||||
$this->invoice->exchange_rate = $this->invoice->client->currency()->exchange_rate;
|
$this->invoice->exchange_rate = $this->invoice->client->currency()->exchange_rate;
|
||||||
|
|
||||||
|
if($settings->counter_number_applied == 'when_saved'){
|
||||||
|
$this->invoice->service()->applyNumber()->save();
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,10 @@ class TriggeredActions extends AbstractService
|
|||||||
{
|
{
|
||||||
|
|
||||||
$reminder_template = $this->quote->calculateTemplate('quote');
|
$reminder_template = $this->quote->calculateTemplate('quote');
|
||||||
//$reminder_template = 'payment';
|
// $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