1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Added option to show/hide signature on the PDF

This commit is contained in:
Hillel Coren 2017-12-27 20:34:36 +02:00
parent 97e4bf0e8d
commit 0fbe83eaaf
19 changed files with 2649 additions and 2408 deletions

View File

@ -180,6 +180,7 @@ class Account extends Eloquent
'task_rate',
'inclusive_taxes',
'convert_products',
'signature_on_pdf',
];
/**

View File

@ -992,6 +992,7 @@ class Invoice extends EntityModel implements BalanceAffecting
'date_format',
'datetime_format',
'timezone',
'signature_on_pdf',
]);
foreach ($this->invitations as $invitation) {

View File

@ -278,6 +278,7 @@ class AccountTransformer extends EntityTransformer
'task_rate' => (float) $account->task_rate,
'inclusive_taxes' => (bool) $account->inclusive_taxes,
'convert_products' => (bool) $account->convert_products,
'signature_on_pdf' => (bool) $account->signature_on_pdf,
];
}
}

View File

@ -51,6 +51,7 @@ class AddRemember2faToken extends Migration
Schema::table('accounts', function ($table) {
$table->boolean('convert_products')->default(false);
$table->boolean('enable_reminder4')->default(false);
$table->boolean('signature_on_pdf')->default(false);
});
Schema::table('invoice_items', function ($table) {
@ -125,6 +126,7 @@ class AddRemember2faToken extends Migration
Schema::table('accounts', function ($table) {
$table->dropColumn('convert_products');
$table->dropColumn('enable_reminder4');
$table->dropColumn('signature_on_pdf');
});
Schema::table('invoice_items', function ($table) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -366,6 +366,10 @@ NINJA.signatureImage = function(invoice) {
return blankImage;
}
if (! parseInt(invoice.account.signature_on_pdf)) {
return blankImage;
}
return invoice.invitations[0].signature_base64 || blankImage;
}
@ -374,8 +378,11 @@ NINJA.signatureDate = function(invoice) {
return '';
}
var date = invoice.invitations[0].signature_date;
if (! parseInt(invoice.account.signature_on_pdf)) {
return '';
}
var date = invoice.invitations[0].signature_date;
return NINJA.formatDateTime(date, invoice.account);
}

View File

@ -2639,7 +2639,9 @@ $LANG = array(
'view_project' => 'View Project',
'summary' => 'Summary',
'endless_reminder' => 'Endless Reminder',
'signature_on_invoice_help' => 'Add the following code to show your client\'s signature on the PDF.'
'signature_on_invoice_help' => 'Add the following code to show your client\'s signature on the PDF.',
'signature_on_pdf' => 'Show on PDF',
'signature_on_pdf_help' => 'Show the client signature on the invoice PDF.',
);

View File

@ -37,6 +37,7 @@
{!! Former::populateField('show_accept_quote_terms', intval($account->show_accept_quote_terms)) !!}
{!! Former::populateField('require_invoice_signature', intval($account->require_invoice_signature)) !!}
{!! Former::populateField('require_quote_signature', intval($account->require_quote_signature)) !!}
{!! Former::populateField('signature_on_pdf', intval($account->signature_on_pdf)) !!}
@include('accounts.nav', ['selected' => ACCOUNT_CLIENT_PORTAL, 'advanced' => true])
@ -195,11 +196,17 @@
->help(trans('texts.require_invoice_signature_help'))
->label(trans('texts.require_invoice_signature'))
->value(1) !!}
{!! Former::checkbox('require_quote_signature')
->text(trans('texts.enable'))
->help(trans('texts.require_quote_signature_help'))
->label(trans('texts.require_quote_signature'))
->value(1) !!}
{!! Former::checkbox('signature_on_pdf')
->text(trans('texts.enable'))
->help(trans('texts.signature_on_pdf_help'))
->value(1) !!}
</div>
</div>
</div>

View File

@ -95,6 +95,28 @@
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack":[
"$invoiceDocuments"

View File

@ -115,6 +115,28 @@
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack": [
"$invoiceDocuments"

View File

@ -113,6 +113,28 @@
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack":[
"$invoiceDocuments"

View File

@ -90,6 +90,28 @@
"text": "$balanceDue",
"style": "subtotalsBalanceDue"
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack": [
"$invoiceDocuments"

View File

@ -95,6 +95,28 @@
{
"canvas": [{ "type": "line", "x1": 270, "y1": 20, "x2": 515, "y2": 20, "lineWidth": 1,"dash": { "length": 2 }}]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack": [
"$invoiceDocuments"

View File

@ -114,6 +114,28 @@
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack": [
"$invoiceDocuments"

View File

@ -86,6 +86,28 @@
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack": [
"$invoiceDocuments"

View File

@ -102,6 +102,28 @@
}
}]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack": [
"$invoiceDocuments"

View File

@ -78,6 +78,28 @@
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack": [
"$invoiceDocuments"

View File

@ -121,6 +121,28 @@
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack": [
"$invoiceDocuments"