mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Ensure all e-invoices are attached to payment mails
This commit is contained in:
parent
cde58fdb4c
commit
89ce1f737a
@ -47,7 +47,7 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, NumberFormatter, MakesInvoiceHtml, PdfMaker, MakesHash, PageNumbering;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, NumberFormatter, MakesInvoiceHtml, PdfMaker, MakesHash, PageNumbering;
|
||||||
|
|
||||||
public $entity;
|
public Invoice | Quote | Credit | RecurringInvoice $entity;
|
||||||
|
|
||||||
public $company;
|
public $company;
|
||||||
|
|
||||||
|
@ -11,15 +11,16 @@
|
|||||||
|
|
||||||
namespace App\Mail\Engine;
|
namespace App\Mail\Engine;
|
||||||
|
|
||||||
use App\DataMapper\EmailTemplateDefaults;
|
|
||||||
use App\Jobs\Entity\CreateRawPdf;
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Utils\Helpers;
|
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use App\Utils\Number;
|
use App\Utils\Number;
|
||||||
|
use App\Utils\Helpers;
|
||||||
|
use App\Models\Account;
|
||||||
use App\Utils\Traits\MakesDates;
|
use App\Utils\Traits\MakesDates;
|
||||||
|
use App\Jobs\Entity\CreateRawPdf;
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
use Illuminate\Support\Facades\URL;
|
use Illuminate\Support\Facades\URL;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use App\DataMapper\EmailTemplateDefaults;
|
||||||
|
|
||||||
class PaymentEmailEngine extends BaseEmailEngine
|
class PaymentEmailEngine extends BaseEmailEngine
|
||||||
{
|
{
|
||||||
@ -105,6 +106,18 @@ class PaymentEmailEngine extends BaseEmailEngine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->client->getSetting('enable_e_invoice'))
|
||||||
|
{
|
||||||
|
|
||||||
|
$e_invoice_filepath = $invoice->service()->getEInvoice($this->contact);
|
||||||
|
|
||||||
|
if(Storage::disk(config('filesystems.default'))->exists($e_invoice_filepath)) {
|
||||||
|
$this->setAttachments([['path' => Storage::disk(config('filesystems.default'))->path($e_invoice_filepath), 'name' => $invoice->getFileName("xml"), 'mime' => null]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user