Fix for logo in invoice footer

This commit is contained in:
Hillel Coren 2017-03-27 14:14:01 +03:00
parent 344fc06315
commit 86ea13ee31
4 changed files with 49 additions and 25 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -58,11 +58,27 @@ function GetPdfMake(invoice, javascript, callback) {
if (invoice.features.customize_invoice_design) {
if (key === 'header') {
return function(page, pages) {
return page === 1 || invoice.account.all_pages_header == '1' ? NINJA.updatePageCount(JSON.parse(JSON.stringify(val)), page, pages) : '';
if (page === 1 || invoice.account.all_pages_header == '1') {
if (invoice.features.remove_created_by) {
return NINJA.updatePageCount(JSON.parse(JSON.stringify(val)), page, pages);
} else {
return val;
}
} else {
return '';
}
}
} else if (key === 'footer') {
return function(page, pages) {
return page === pages || invoice.account.all_pages_footer == '1' ? NINJA.updatePageCount(JSON.parse(JSON.stringify(val)), page, pages) : '';
if (page === pages || invoice.account.all_pages_footer == '1') {
if (invoice.features.remove_created_by) {
return NINJA.updatePageCount(JSON.parse(JSON.stringify(val)), page, pages);
} else {
return val;
}
} else {
return '';
}
}
}
}
@ -282,7 +298,15 @@ NINJA.decodeJavascript = function(invoice, javascript)
var match = matches[i];
// reserved words
if (['"$none"', '"$firstAndLast"', '"$notFirstAndLastColumn"', '"$notFirst"', '"$amount"', '"$primaryColor"', '"$secondaryColor"'].indexOf(match) >= 0) {
if ([
'"$none"',
'"$firstAndLast"',
'"$notFirstAndLastColumn"',
'"$notFirst"',
'"$amount"',
'"$primaryColor"',
'"$secondaryColor"',
].indexOf(match) >= 0) {
continue;
}

View File

@ -312,7 +312,7 @@
<div class="panel-body">
{!! Former::textarea('invoice_footer')
->label(trans('texts.default_invoice_footer'))
->help('invoice_footer_help')
->help($account->hasFeature(FEATURE_REMOVE_CREATED_BY) && ! $account->isTrial() ? 'invoice_footer_help' : '')
->rows(4) !!}
</div>
</div>