Merge template formatting

This commit is contained in:
Hillel Coren 2017-11-08 20:36:02 +02:00
parent e11fcd30ae
commit 51a16de01b
2 changed files with 664 additions and 464 deletions

View File

@ -1,135 +1,180 @@
{ {
"content": [ "content":[
{ {
"columns": [ "columns":[
{ {
"width": 380, "width":380,
"stack": [ "stack":[
{"text":"$yourInvoiceLabelUC", "style": "yourInvoice"}, {
"text":"$yourInvoiceLabelUC",
"style":"yourInvoice"
},
"$clientDetails" "$clientDetails"
], ],
"margin": [60, 100, 0, 10] "margin":[
60,
100,
0,
10
]
}, },
{ {
"canvas": [ "canvas":[
{ {
"type": "rect", "type":"rect",
"x": 0, "x":0,
"y": 0, "y":0,
"w": 225, "w":225,
"h": "$invoiceDetailsHeight", "h":"$invoiceDetailsHeight",
"r":0, "r":0,
"lineWidth": 1, "lineWidth":1,
"color": "$primaryColor:#36a498" "color":"$primaryColor:#36a498"
} }
], ],
"width":10, "width":10,
"margin":[-10,100,0,10] "margin":[
-10,
100,
0,
10
]
}, },
{ {
"table": { "table":{
"body": "$invoiceDetails" "body":"$invoiceDetails"
}, },
"layout": "noBorders", "layout":"noBorders",
"margin": [0, 110, 0, 0] "margin":[
0,
110,
0,
0
]
} }
] ]
}, },
{ {
"style": "invoiceLineItemsTable", "style":"invoiceLineItemsTable",
"table": { "table":{
"headerRows": 1, "headerRows":1,
"widths": "$invoiceLineItemColumns", "widths":"$invoiceLineItemColumns",
"body": "$invoiceLineItems" "body":"$invoiceLineItems"
}, },
"layout": { "layout":{
"hLineWidth": "$none", "hLineWidth":"$none",
"vLineWidth": "$none", "vLineWidth":"$none",
"paddingLeft": "$amount:8", "paddingLeft":"$amount:8",
"paddingRight": "$amount:8", "paddingRight":"$amount:8",
"paddingTop": "$amount:14", "paddingTop":"$amount:14",
"paddingBottom": "$amount:14" "paddingBottom":"$amount:14"
} }
}, },
{ {
"columns": [ "columns":[
{ {
"width": 46, "width":46,
"text": " " "text":" "
}, },
"$notesAndTerms", "$notesAndTerms",
{ {
"table": { "table":{
"widths": ["*", "40%"], "widths":[
"body": "$subtotals" "*",
"40%"
],
"body":"$subtotals"
}, },
"layout": { "layout":{
"hLineWidth": "$none", "hLineWidth":"$none",
"vLineWidth": "$none", "vLineWidth":"$none",
"paddingLeft": "$amount:8", "paddingLeft":"$amount:8",
"paddingRight": "$amount:8", "paddingRight":"$amount:8",
"paddingTop": "$amount:4", "paddingTop":"$amount:4",
"paddingBottom": "$amount:4" "paddingBottom":"$amount:4"
} }
}] }
]
}, },
{ {
"stack": [ "stack":[
"$invoiceDocuments" "$invoiceDocuments"
], ],
"style": "invoiceDocuments" "style":"invoiceDocuments"
} }
], ],
"footer": "footer":[
[
{"canvas": [{ "type": "line", "x1": 0, "y1": 0, "x2": 600, "y2": 0,"lineWidth": 100,"lineColor":"$secondaryColor:#292526"}]},
{ {
"columns": "canvas":[
[
{ {
"text": "$invoiceFooter", "type":"line",
"margin": [40, -40, 40, 0], "x1":0,
"alignment": "left", "y1":0,
"color": "#FFFFFF" "x2":600,
"y2":0,
"lineWidth":100,
"lineColor":"$secondaryColor:#292526"
}
]
},
{
"columns":[
{
"text":"$invoiceFooter",
"margin":[
40,
-40,
40,
0
],
"alignment":"left",
"color":"#FFFFFF"
} }
] ]
} }
], ],
"header": [ "header":[
{ {
"canvas": [ "canvas":[
{ {
"type": "line", "type":"line",
"x1": 0, "x1":0,
"y1": 0, "y1":0,
"x2": 600, "x2":600,
"y2": 0, "y2":0,
"lineWidth": 200, "lineWidth":200,
"lineColor": "$secondaryColor:#292526" "lineColor":"$secondaryColor:#292526"
} }
], ],
"width": 10 "width":10
}, },
{ {
"columns": [ "columns":[
{ {
"image": "$accountLogo", "image":"$accountLogo",
"fit": [120, 60], "fit":[
"margin": [30, 16, 0, 0] 120,
60
],
"margin":[
30,
16,
0,
0
]
}, },
{ {
"stack": "$accountDetails", "stack":"$accountDetails",
"margin": [ "margin":[
0, 0,
16, 16,
0, 0,
0 0
], ],
"width": 140 "width":140
}, },
{ {
"stack": "$accountAddress", "stack":"$accountAddress",
"margin": [ "margin":[
20, 20,
16, 16,
0, 0,
@ -139,128 +184,203 @@
] ]
} }
], ],
"defaultStyle": { "defaultStyle":{
"font": "$bodyFont", "font":"$bodyFont",
"fontSize": "$fontSize", "fontSize":"$fontSize",
"margin": [8, 4, 8, 4] "margin":[
8,
4,
8,
4
]
}, },
"styles": { "styles":{
"primaryColor":{ "primaryColor":{
"color": "$primaryColor:#36a498" "color":"$primaryColor:#36a498"
}, },
"accountName": { "accountName":{
"bold": true, "bold":true,
"margin": [4, 2, 4, 1], "margin":[
"color": "$primaryColor:#36a498" 4,
2,
4,
1
],
"color":"$primaryColor:#36a498"
}, },
"accountDetails": { "accountDetails":{
"margin": [4, 2, 4, 1], "margin":[
"color": "#FFFFFF" 4,
2,
4,
1
],
"color":"#FFFFFF"
}, },
"accountAddress": { "accountAddress":{
"margin": [4, 2, 4, 1], "margin":[
"color": "#FFFFFF" 4,
2,
4,
1
],
"color":"#FFFFFF"
}, },
"clientDetails": { "clientDetails":{
"margin": [0, 2, 0, 1] "margin":[
0,
2,
0,
1
]
}, },
"odd": { "odd":{
"fillColor": "#ebebeb" "fillColor":"#ebebeb"
}, },
"subtotalsBalanceDueLabel": { "subtotalsBalanceDueLabel":{
"fontSize": "$fontSizeLargest", "fontSize":"$fontSizeLargest",
"bold": true "bold":true
}, },
"subtotalsBalanceDue": { "subtotalsBalanceDue":{
"fontSize": "$fontSizeLargest", "fontSize":"$fontSizeLargest",
"color": "$primaryColor:#36a498", "color":"$primaryColor:#36a498",
"bold": true "bold":true
}, },
"invoiceDetails": { "invoiceDetails":{
"color": "#ffffff" "color":"#ffffff"
}, },
"invoiceNumber": { "invoiceNumber":{
"bold": true "bold":true
}, },
"tableHeader": { "tableHeader":{
"fontSize": 12, "fontSize":12,
"bold": true "bold":true
}, },
"costTableHeader": { "costTableHeader":{
"alignment": "right" "alignment":"right"
}, },
"qtyTableHeader": { "qtyTableHeader":{
"alignment": "right" "alignment":"right"
}, },
"taxTableHeader": { "taxTableHeader":{
"alignment": "right" "alignment":"right"
}, },
"lineTotalTableHeader": { "lineTotalTableHeader":{
"alignment": "right", "alignment":"right",
"margin": [0, 0, 40, 0] "margin":[
0,
0,
40,
0
]
}, },
"firstColumn": { "firstColumn":{
"margin": [40, 0, 0, 0] "margin":[
40,
0,
0,
0
]
}, },
"lastColumn": { "lastColumn":{
"margin": [0, 0, 40, 0] "margin":[
0,
0,
40,
0
]
}, },
"productKey": { "productKey":{
"color": "$primaryColor:#36a498", "color":"$primaryColor:#36a498",
"bold": true "bold":true
}, },
"yourInvoice": { "yourInvoice":{
"font": "$headerFont", "font":"$headerFont",
"bold": true, "bold":true,
"fontSize": 14, "fontSize":14,
"color": "$primaryColor:#36a498", "color":"$primaryColor:#36a498",
"margin": [0,0,0,8] "margin":[
0,
0,
0,
8
]
}, },
"invoiceLineItemsTable": { "invoiceLineItemsTable":{
"margin": [0, 26, 0, 16] "margin":[
0,
26,
0,
16
]
}, },
"clientName": { "clientName":{
"bold": true "bold":true
}, },
"cost": { "cost":{
"alignment": "right" "alignment":"right"
}, },
"quantity": { "quantity":{
"alignment": "right" "alignment":"right"
}, },
"tax": { "tax":{
"alignment": "right" "alignment":"right"
}, },
"lineTotal": { "lineTotal":{
"alignment": "right" "alignment":"right"
}, },
"subtotals": { "subtotals":{
"alignment": "right", "alignment":"right",
"margin": [0,0,40,0] "margin":[
0,
0,
40,
0
]
}, },
"termsLabel": { "termsLabel":{
"bold": true, "bold":true,
"margin": [0, 0, 0, 4] "margin":[
0,
0,
0,
4
]
}, },
"fullheader": { "fullheader":{
"font": "$headerFont", "font":"$headerFont",
"fontSize": "$fontSizeLargest", "fontSize":"$fontSizeLargest",
"bold": true "bold":true
}, },
"subheader": { "subheader":{
"font": "$headerFont", "font":"$headerFont",
"fontSize": "$fontSizeLarger" "fontSize":"$fontSizeLarger"
}, },
"help": { "help":{
"fontSize": "$fontSizeSmaller", "fontSize":"$fontSizeSmaller",
"color": "#737373" "color":"#737373"
}, },
"invoiceDocuments": { "invoiceDocuments":{
"margin": [47, 0, 47, 0] "margin":[
47,
0,
47,
0
]
}, },
"invoiceDocument": { "invoiceDocument":{
"margin": [0, 10, 0, 10] "margin":[
0,
10,
0,
10
]
} }
}, },
"pageMargins": [0, 80, 0, 40] "pageMargins":[
} 0,
80,
0,
40
]
}

View File

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