mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 15:04:32 -04:00
Don't render pdf if not attached and fix typo
This commit is contained in:
parent
a7f9847978
commit
d175fc872a
@ -1317,7 +1317,7 @@ class Account extends Eloquent
|
||||
return Utils::isEmpty($entity->$field) ? false : true;
|
||||
}
|
||||
|
||||
public function attatchPDF()
|
||||
public function attachPDF()
|
||||
{
|
||||
return $this->hasFeature(FEATURE_PDF_ATTACHMENT) && $this->pdf_email_attachment;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ class ContactMailer extends Mailer
|
||||
|
||||
$sent = false;
|
||||
|
||||
if ($account->attatchPDF() && !$pdfString) {
|
||||
if ($account->attachPDF() && !$pdfString) {
|
||||
$pdfString = $invoice->getPDFString();
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ class ContactMailer extends Mailer
|
||||
'documents' => $documentStrings,
|
||||
];
|
||||
|
||||
if ($account->attatchPDF()) {
|
||||
if ($account->attachPDF()) {
|
||||
$data['pdfString'] = $pdfString;
|
||||
$data['pdfFileName'] = $invoice->getFileName();
|
||||
}
|
||||
@ -235,7 +235,7 @@ class ContactMailer extends Mailer
|
||||
'entityType' => ENTITY_INVOICE,
|
||||
];
|
||||
|
||||
if ($account->attatchPDF()) {
|
||||
if ($account->attachPDF()) {
|
||||
$data['pdfString'] = $invoice->getPDFString();
|
||||
$data['pdfFileName'] = $invoice->getFileName();
|
||||
}
|
||||
|
@ -1209,8 +1209,13 @@
|
||||
if (confirm('{!! trans("texts.confirm_email_$entityType") !!}' + '\n\n' + getSendToEmails())) {
|
||||
var accountLanguageId = parseInt({{ $account->language_id ?: '0' }});
|
||||
var clientLanguageId = parseInt(model.invoice().client().language_id()) || 0;
|
||||
var attachPDF = {{ $account->attachPDF() ? 'true' : 'false' }};
|
||||
|
||||
// if they aren't attaching the pdf no need to generate it
|
||||
if ( ! attachPDF) {
|
||||
submitAction('email');
|
||||
// if the client's language is different then we can't use the browser version of the PDF
|
||||
if (clientLanguageId && clientLanguageId != accountLanguageId) {
|
||||
} else if (clientLanguageId && clientLanguageId != accountLanguageId) {
|
||||
submitAction('email');
|
||||
} else {
|
||||
preparePdfData('email');
|
||||
|
Loading…
x
Reference in New Issue
Block a user