1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-19 16:01:34 +02:00

Use in PDF design

This commit is contained in:
Hillel Coren 2018-03-23 17:18:11 +03:00
parent d5924bc523
commit 9720e66675
13 changed files with 219 additions and 429 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

@ -403,16 +403,16 @@ NINJA.signature = function(invoice) {
"canvas": [{
"type": "line",
"x1": 200,
"y1": -65,
"y1": -25,
"x2": 504,
"y2": -65,
"y2": -25,
"lineWidth": 1,
"lineColor": "#888888"
}]
},
{
"text": [invoiceLabels.date, ": ", "$signatureDate"],
"margin": [200, -60, 0, 0]
"margin": [200, -20, 0, 0]
}
]
};

View File

@ -1,26 +1,26 @@
{
"content":[
{
"columns":[
{
{
"content":[
{
"columns":[
{
"width":380,
"stack":[
{
"stack":[
{
"text":"$yourInvoiceLabelUC",
"style":"yourInvoice"
},
"$clientDetails"
],
"margin":[
"margin":[
60,
100,
0,
10
]
},
{
"canvas":[
{
{
"canvas":[
{
"type":"rect",
"x":0,
"y":0,
@ -32,19 +32,19 @@
}
],
"width":10,
"margin":[
"margin":[
-10,
100,
0,
10
]
},
{
"table":{
{
"table":{
"body":"$invoiceDetails"
},
"layout":"noBorders",
"margin":[
"margin":[
0,
110,
0,
@ -53,14 +53,14 @@
}
]
},
{
{
"style":"invoiceLineItemsTable",
"table":{
"table":{
"headerRows":1,
"widths":"$invoiceLineItemColumns",
"body":"$invoiceLineItems"
},
"layout":{
"layout":{
"hLineWidth":"$none",
"vLineWidth":"$none",
"paddingLeft":"$amount:8",
@ -69,22 +69,22 @@
"paddingBottom":"$amount:14"
}
},
{
"columns":[
{
{
"columns":[
{
"width":46,
"text":" "
},
"$notesAndTerms",
{
"table":{
"widths":[
{
"table":{
"widths":[
"*",
"40%"
],
"body":"$subtotals"
},
"layout":{
"layout":{
"hLineWidth":"$none",
"vLineWidth":"$none",
"paddingLeft":"$amount:8",
@ -95,39 +95,18 @@
}
]
},
"$signature",
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack":[
"stack":[
"$invoiceDocuments"
],
"style":"invoiceDocuments"
}
],
"footer":[
{
"canvas":[
{
"footer":[
{
"canvas":[
{
"type":"line",
"x1":0,
"y1":0,
@ -138,11 +117,11 @@
}
]
},
{
"columns":[
{
{
"columns":[
{
"text":"$invoiceFooter",
"margin":[
"margin":[
40,
-40,
40,
@ -154,10 +133,10 @@
]
}
],
"header":[
{
"canvas":[
{
"header":[
{
"canvas":[
{
"type":"line",
"x1":0,
"y1":0,
@ -169,24 +148,24 @@
],
"width":10
},
{
"columns":[
{
{
"columns":[
{
"image":"$accountLogo",
"fit":[
"fit":[
120,
60
],
"margin":[
"margin":[
30,
16,
0,
0
]
},
{
{
"stack":"$accountDetails",
"margin":[
"margin":[
0,
16,
0,
@ -194,9 +173,9 @@
],
"width":140
},
{
{
"stack":"$accountAddress",
"margin":[
"margin":[
20,
16,
0,
@ -206,23 +185,23 @@
]
}
],
"defaultStyle":{
"defaultStyle":{
"font":"$bodyFont",
"fontSize":"$fontSize",
"margin":[
"margin":[
8,
4,
8,
4
]
},
"styles":{
"primaryColor":{
"styles":{
"primaryColor":{
"color":"$primaryColor:#36a498"
},
"accountName":{
"accountName":{
"bold":true,
"margin":[
"margin":[
4,
2,
4,
@ -230,8 +209,8 @@
],
"color":"$primaryColor:#36a498"
},
"accountDetails":{
"margin":[
"accountDetails":{
"margin":[
4,
2,
4,
@ -239,8 +218,8 @@
],
"color":"#FFFFFF"
},
"accountAddress":{
"margin":[
"accountAddress":{
"margin":[
4,
2,
4,
@ -248,150 +227,150 @@
],
"color":"#FFFFFF"
},
"clientDetails":{
"margin":[
"clientDetails":{
"margin":[
0,
2,
0,
1
]
},
"odd":{
"odd":{
"fillColor":"#ebebeb"
},
"subtotalsBalanceDueLabel":{
"subtotalsBalanceDueLabel":{
"fontSize":"$fontSizeLargest",
"bold":true
},
"subtotalsBalanceDue":{
"subtotalsBalanceDue":{
"fontSize":"$fontSizeLargest",
"color":"$primaryColor:#36a498",
"bold":true
},
"invoiceDetails":{
"invoiceDetails":{
"color":"#ffffff"
},
"invoiceNumber":{
"invoiceNumber":{
"bold":true
},
"tableHeader":{
"tableHeader":{
"fontSize":12,
"bold":true
},
"costTableHeader":{
"costTableHeader":{
"alignment":"right"
},
"qtyTableHeader":{
"qtyTableHeader":{
"alignment":"right"
},
"taxTableHeader":{
"taxTableHeader":{
"alignment":"right"
},
"lineTotalTableHeader":{
"lineTotalTableHeader":{
"alignment":"right",
"margin":[
"margin":[
0,
0,
40,
0
]
},
"firstColumn":{
"margin":[
"firstColumn":{
"margin":[
40,
0,
0,
0
]
},
"lastColumn":{
"margin":[
"lastColumn":{
"margin":[
0,
0,
40,
0
]
},
"productKey":{
"productKey":{
"color":"$primaryColor:#36a498",
"bold":true
},
"yourInvoice":{
"yourInvoice":{
"font":"$headerFont",
"bold":true,
"fontSize":14,
"color":"$primaryColor:#36a498",
"margin":[
"margin":[
0,
0,
0,
8
]
},
"invoiceLineItemsTable":{
"margin":[
"invoiceLineItemsTable":{
"margin":[
0,
26,
0,
16
]
},
"clientName":{
"clientName":{
"bold":true
},
"cost":{
"cost":{
"alignment":"right"
},
"quantity":{
"quantity":{
"alignment":"right"
},
"tax":{
"tax":{
"alignment":"right"
},
"lineTotal":{
"lineTotal":{
"alignment":"right"
},
"subtotals":{
"subtotals":{
"alignment":"right",
"margin":[
"margin":[
0,
0,
40,
0
]
},
"termsLabel":{
"termsLabel":{
"bold":true,
"margin":[
"margin":[
0,
0,
0,
4
]
},
"fullheader":{
"fullheader":{
"font":"$headerFont",
"fontSize":"$fontSizeLargest",
"bold":true
},
"subheader":{
"subheader":{
"font":"$headerFont",
"fontSize":"$fontSizeLarger"
},
"help":{
"help":{
"fontSize":"$fontSizeSmaller",
"color":"#737373"
},
"invoiceDocuments":{
"margin":[
"invoiceDocuments":{
"margin":[
47,
0,
47,
0
]
},
"invoiceDocument":{
"margin":[
"invoiceDocument":{
"margin":[
0,
10,
0,
@ -399,7 +378,7 @@
]
}
},
"pageMargins":[
"pageMargins":[
0,
80,
0,

View File

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

View File

@ -1,31 +1,31 @@
{
"content":[
{
"columns":[
{
{
"content":[
{
"columns":[
{
"image":"$accountLogo",
"fit":[
"fit":[
120,
80
]
},
{
{
"stack":"$accountDetails",
"margin":[
"margin":[
7,
0,
0,
0
]
},
{
{
"stack":"$accountAddress"
}
]
},
{
{
"text":"$entityTypeUC",
"margin":[
"margin":[
8,
30,
8,
@ -33,21 +33,21 @@
],
"style":"entityTypeLabel"
},
{
"table":{
{
"table":{
"headerRows":1,
"widths":[
"widths":[
"auto",
"auto",
"*"
],
"body":[
[
{
"table":{
"body":[
[
{
"table":{
"body":"$invoiceDetails"
},
"margin":[
"margin":[
0,
0,
12,
@ -55,16 +55,16 @@
],
"layout":"noBorders"
},
{
{
"stack":"$clientDetails"
},
{
{
"text":""
}
]
]
},
"layout":{
"layout":{
"hLineWidth":"$firstAndLast:.5",
"vLineWidth":"$none",
"hLineColor":"#D8D8D8",
@ -74,14 +74,14 @@
"paddingBottom":"$amount:6"
}
},
{
{
"style":"invoiceLineItemsTable",
"table":{
"table":{
"headerRows":1,
"widths":"$invoiceLineItemColumns",
"body":"$invoiceLineItems"
},
"layout":{
"layout":{
"hLineWidth":"$notFirst:.5",
"vLineWidth":"$none",
"hLineColor":"#D8D8D8",
@ -91,18 +91,18 @@
"paddingBottom":"$amount:14"
}
},
{
"columns":[
{
"columns":[
"$notesAndTerms",
{
"table":{
"widths":[
{
"table":{
"widths":[
"*",
"40%"
],
"body":"$subtotals"
},
"layout":{
"layout":{
"hLineWidth":"$none",
"vLineWidth":"$none",
"paddingLeft":"$amount:34",
@ -113,197 +113,176 @@
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
"$signature",
{
"stack":[
"stack":[
"$invoiceDocuments"
],
"style":"invoiceDocuments"
}
],
"defaultStyle":{
"defaultStyle":{
"font":"$bodyFont",
"fontSize":"$fontSize",
"margin":[
"margin":[
8,
4,
8,
4
]
},
"footer":{
"columns":[
{
"footer":{
"columns":[
{
"text":"$invoiceFooter",
"alignment":"left"
}
],
"margin":[
"margin":[
40,
-20,
40,
0
]
},
"styles":{
"entityTypeLabel":{
"styles":{
"entityTypeLabel":{
"font":"$headerFont",
"fontSize":"$fontSizeLargest",
"color":"$primaryColor:#37a3c6"
},
"primaryColor":{
"primaryColor":{
"color":"$primaryColor:#37a3c6"
},
"accountName":{
"accountName":{
"color":"$primaryColor:#37a3c6",
"bold":true
},
"invoiceDetails":{
"margin":[
"invoiceDetails":{
"margin":[
0,
0,
8,
0
]
},
"accountDetails":{
"margin":[
"accountDetails":{
"margin":[
0,
2,
0,
2
]
},
"clientDetails":{
"margin":[
"clientDetails":{
"margin":[
0,
2,
0,
2
]
},
"notesAndTerms":{
"margin":[
"notesAndTerms":{
"margin":[
0,
2,
0,
2
]
},
"accountAddress":{
"margin":[
"accountAddress":{
"margin":[
0,
2,
0,
2
]
},
"odd":{
"odd":{
"fillColor":"#fbfbfb"
},
"productKey":{
"productKey":{
"color":"$primaryColor:#37a3c6",
"bold":true
},
"subtotalsBalanceDueLabel":{
"subtotalsBalanceDueLabel":{
"fontSize":"$fontSizeLarger"
},
"subtotalsBalanceDue":{
"subtotalsBalanceDue":{
"fontSize":"$fontSizeLarger",
"color":"$primaryColor:#37a3c6"
},
"invoiceNumber":{
"invoiceNumber":{
"bold":true
},
"tableHeader":{
"tableHeader":{
"bold":true,
"fontSize":"$fontSizeLarger"
},
"costTableHeader":{
"costTableHeader":{
"alignment":"right"
},
"qtyTableHeader":{
"qtyTableHeader":{
"alignment":"right"
},
"taxTableHeader":{
"taxTableHeader":{
"alignment":"right"
},
"lineTotalTableHeader":{
"lineTotalTableHeader":{
"alignment":"right"
},
"invoiceLineItemsTable":{
"margin":[
"invoiceLineItemsTable":{
"margin":[
0,
16,
0,
16
]
},
"clientName":{
"clientName":{
"bold":true
},
"cost":{
"cost":{
"alignment":"right"
},
"quantity":{
"quantity":{
"alignment":"right"
},
"tax":{
"tax":{
"alignment":"right"
},
"lineTotal":{
"lineTotal":{
"alignment":"right"
},
"subtotals":{
"subtotals":{
"alignment":"right"
},
"termsLabel":{
"termsLabel":{
"bold":true
},
"fullheader":{
"fullheader":{
"font":"$headerFont",
"fontSize":"$fontSizeLargest",
"bold":true
},
"subheader":{
"subheader":{
"font":"$headerFont",
"fontSize":"$fontSizeLarger"
},
"help":{
"help":{
"fontSize":"$fontSizeSmaller",
"color":"#737373"
},
"invoiceDocuments":{
"margin":[
"invoiceDocuments":{
"margin":[
7,
0,
7,
0
]
},
"invoiceDocument":{
"margin":[
"invoiceDocument":{
"margin":[
0,
10,
0,
@ -311,7 +290,7 @@
]
}
},
"pageMargins":[
"pageMargins":[
40,
40,
40,

View File

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

View File

@ -95,28 +95,7 @@
{
"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
]
}
]
},
"$signature",
{
"stack": [
"$invoiceDocuments"

View File

@ -9,8 +9,8 @@
{
"width":120,
"stack": [
{"text": "$fromLabelUC", "style": "fromLabel"},
"$accountDetails"
{"text": "$fromLabelUC", "style": "fromLabel"},
"$accountDetails"
]
},
{
@ -27,7 +27,7 @@
},
{
"stack": [
{"text": "$toLabelUC", "style": "toLabel"},
{"text": "$toLabelUC", "style": "toLabel"},
"$clientDetails"
]
},
@ -83,10 +83,10 @@
"layout": {
"hLineWidth": "$none",
"vLineWidth": "$amount:.5",
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:8",
"paddingBottom": "$amount:8"
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:8",
"paddingBottom": "$amount:8"
}
},
{
@ -106,36 +106,15 @@
"layout": {
"hLineWidth": "$none",
"vLineWidth": "$notFirst:.5",
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:12",
"paddingBottom": "$amount:4"
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:12",
"paddingBottom": "$amount:4"
}
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
"$signature",
{
"stack": [
"$invoiceDocuments"
@ -187,14 +166,14 @@
},
"lineTotalTableHeader": {
"alignment": "right"
},
},
"fromLabel": {
"color": "$primaryColor:#bc9f2b",
"bold": true
"bold": true
},
"toLabel": {
"color": "$primaryColor:#bc9f2b",
"bold": true
"bold": true
},
"accountDetails": {
"margin": [0, 2, 0, 1]
@ -219,7 +198,7 @@
},
"subtotals": {
"alignment": "right"
},
},
"termsLabel": {
"bold": true,
"margin": [0, 16, 0, 4]

View File

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

View File

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

View File

@ -13,7 +13,7 @@
"image": "$accountLogo",
"fit": [120, 80]
}
]
]
]},
{
"columns": [
@ -24,19 +24,19 @@
},
{
"width":200,
"table": {
"table": {
"body": "$invoiceDetails"
},
"layout": {
"hLineWidth": "$none",
"vLineWidth": "$none",
"hLineColor": "#E6E6E6",
"paddingLeft": "$amount:10",
"paddingLeft": "$amount:10",
"paddingRight": "$amount:10"
}
}
]
},
},
{
"canvas": [{ "type": "rect", "x": 0, "y": 0, "w": 515, "h": 25,"r":0, "lineWidth": 1,"color":"#e6e6e6"}],"width":10,"margin":[0,30,0,-43]
},
@ -51,10 +51,10 @@
"hLineWidth": "$notFirst:1",
"vLineWidth": "$none",
"hLineColor": "#e6e6e6",
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:8",
"paddingBottom": "$amount:8"
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:8",
"paddingBottom": "$amount:8"
}
},
{
@ -70,36 +70,15 @@
"layout": {
"hLineWidth": "$none",
"vLineWidth": "$none",
"paddingLeft": "$amount:10",
"paddingRight": "$amount:10",
"paddingTop": "$amount:4",
"paddingBottom": "$amount:4"
"paddingLeft": "$amount:10",
"paddingRight": "$amount:10",
"paddingTop": "$amount:4",
"paddingBottom": "$amount:4"
}
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
"$signature",
{
"stack": [
"$invoiceDocuments"
@ -147,7 +126,7 @@
},
"lineTotalTableHeader": {
"alignment": "right"
},
},
"invoiceLineItemsTable": {
"margin": [0, 16, 0, 16]
},
@ -165,7 +144,7 @@
},
"subtotals": {
"alignment": "right"
},
},
"termsLabel": {
"bold": true,
"margin": [0, 0, 0, 4]

View File

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