mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 12:42:36 +01:00
Added 'preview' watermark
This commit is contained in:
parent
9bbdac40c0
commit
af6eb2f416
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -157,7 +157,13 @@ function GetPdfMake(invoice, javascript, callback) {
|
||||
// set page size
|
||||
dd.pageSize = invoice.account.page_size;
|
||||
|
||||
//dd.watermark = {text: 'PAID', color: 'blue', opacity: 0.3};
|
||||
if (invoice.watermark) {
|
||||
dd.watermark = {
|
||||
text: invoice.watermark,
|
||||
color: 'black',
|
||||
opacity: 0.04,
|
||||
};
|
||||
}
|
||||
|
||||
pdfMake.fonts = {}
|
||||
fonts = window.invoiceFonts || invoice.invoice_fonts;
|
||||
|
@ -1162,7 +1162,9 @@
|
||||
|
||||
function createInvoiceModel() {
|
||||
var model = ko.toJS(window.model);
|
||||
if(!model)return;
|
||||
if (! model) {
|
||||
return;
|
||||
}
|
||||
var invoice = model.invoice;
|
||||
invoice.features = {
|
||||
customize_invoice_design:{{ Auth::user()->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN) ? 'true' : 'false' }},
|
||||
@ -1194,6 +1196,10 @@
|
||||
invoice.imageHeight = {{ $account->getLogoHeight() }};
|
||||
@endif
|
||||
|
||||
if (! invoice.public_id || NINJA.formIsChanged) {
|
||||
invoice.watermark = "{{ trans('texts.preview') }}";
|
||||
}
|
||||
|
||||
return invoice;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user