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

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

View File

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