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

Handle second user signature

This commit is contained in:
Hillel Coren 2017-12-28 10:02:59 +02:00
parent 7012b6c87e
commit 39f206245c
4 changed files with 62 additions and 29 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

@ -370,7 +370,18 @@ NINJA.signatureImage = function(invoice) {
return blankImage;
}
return invoice.invitations[0].signature_base64 || blankImage;
for (var i=0; i<invoice.invitations.length; i++) {
var invitation = invoice.invitations[i];
if (invitation.signature_base64) {
break;
}
}
if (! invitation.signature_base64) {
return blankImage;
}
return invitation.signature_base64 || blankImage;
}
NINJA.signatureDate = function(invoice) {
@ -382,7 +393,18 @@ NINJA.signatureDate = function(invoice) {
return '';
}
var date = invoice.invitations[0].signature_date;
for (var i=0; i<invoice.invitations.length; i++) {
var invitation = invoice.invitations[i];
if (invitation.signature_base64) {
break;
}
}
if (! invitation.signature_base64) {
return '';
}
var date = invitation.signature_date;
return NINJA.formatDateTime(date, invoice.account);
}

View File

@ -187,7 +187,18 @@
return invoice;
}
var sourceSVG = invoice.invitations[0].signature_base64;
for (var i=0; i<invoice.invitations.length; i++) {
var invitation = invoice.invitations[i];
if (invitation.signature_base64) {
break;
}
}
if (! invitation.signature_base64) {
return invoice;
}
var sourceSVG = invitation.signature_base64;
if (! sourceSVG || sourceSVG.indexOf('data:image') == 0) {
return invoice;
}