1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-18 23:42:25 +02:00

Added 'preview' watermark

This commit is contained in:
Hillel Coren 2018-02-15 10:29:45 +02:00
parent 9bbdac40c0
commit af6eb2f416
4 changed files with 17 additions and 5 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

@ -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;

View File

@ -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;
}