Fix for attached PDF being in the wrong language
This commit is contained in:
parent
371f224c24
commit
3b0feef87f
1 changed files with 9 additions and 2 deletions
|
|
@ -1185,10 +1185,17 @@
|
|||
if (!isEmailValid()) {
|
||||
alert("{!! trans('texts.provide_email') !!}");
|
||||
return;
|
||||
}
|
||||
8 }
|
||||
|
||||
if (confirm('{!! trans("texts.confirm_email_$entityType") !!}' + '\n\n' + getSendToEmails())) {
|
||||
preparePdfData('email');
|
||||
var accountLanguageId = parseInt({{ $account->language_id ?: '0' }});
|
||||
var clientLanguageId = parseInt(model.invoice().client().language_id()) || 0;
|
||||
// if the client's language is different then we can't use the browser version of the PDF
|
||||
if (clientLanguageId && clientLanguageId != accountLanguageId) {
|
||||
submitAction('email');
|
||||
} else {
|
||||
preparePdfData('email');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue