Where and how can I correct this?
Thanks in advance.
Content
[
{
"columns": [
{
"image": "$accountLogo",
"fit": [
180,
80
]
},
{
"table": {
"body": "$invoiceDetails"
},
"layout": "noBorders",
"alignment": "right",
"margin": [
0,
0,
0,
0
]
}
]
},
{
"text": "Cliente:",
"margin": [
240,
20,
0,
0
]
},
{
"stack": "$clientDetails",
"margin": [
180,
-14,
0,
0
]
},
{
"canvas": [
{
"type": "line",
"x1": 0,
"y1": 5,
"x2": 515,
"y2": 5,
"lineWidth": 1
}
],
"margin": [
0,
30,
0,
-30
]
},
{
"canvas": [
{
"type": "rect",
"x": 0,
"y": 1,
"w": 515,
"h": 38,
"r": 0,
"lineWidth": 1,
"color": "#E0ECF8"
}
],
"width": 10,
"margin": [
0,
30,
0,
-57
]
},
{
"canvas": [
{
"type": "line",
"x1": 0,
"y1": 56,
"x2": 515,
"y2": 56,
"lineWidth": 1
}
],
"margin": [
0,
0,
0,
-56
]
},
{
"style": "invoiceLineItemsTable",
"table": {
"headerRows": 1,
"widths": [
"6%",
"25%",
"47%",
"11%",
"11%"
],
"body": "$invoiceLineItems"
},
"layout": {
"hLineWidth": "$notFirst:.5",
"vLineWidth": "$none",
"hLineColor": "#D8D8D8",
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:14",
"paddingBottom": "$amount:14"
}
},
{
"canvas": [
{
"type": "rect",
"x": 333,
"y": 50,
"w": 185,
"h": 32,
"r": 10,
"lineWidth": 1,
"color": "#E0ECF8"
}
],
"width": 5,
"margin": [
0,
0,
0,
0
]
},
{
"margin": [
0,
-70,
0,
0
],
"columns": [
"$notesAndTerms",
{
"table": {
"widths": [
"*",
"48%"
],
"body": "$subtotals"
},
"layout": {
"hLineWidth": "$none",
"vLineWidth": "$none",
"paddingLeft": "$amount:34",
"paddingRight": "$amount:8",
"paddingTop": "$amount:4",
"paddingBottom": "$amount:4"
}
}
]
},
{
"stack": [
{
"image": "$signatureBase64",
"margin": [
200,
10,
0,
0
]
},
{
"text": "$signatureDate",
"margin": [
200,
-40,
0,
0
]
}
]
},
{
"stack": [
"$invoiceDocuments"
],
"style": "invoiceDocuments"
}
]
Styles
{
"entityTypeLabel": {
"font": "$headerFont",
"fontSize": "$fontSizeLargest",
"color": "$primaryColor:#37a3c6"
},
"primaryColor": {
"color": "$primaryColor:#37a3c6"
},
"accountName": {
"color": "$primaryColor:#37a3c6",
"bold": true
},
"invoiceDetails": {
"margin": [
50,
0,
-50,
0
]
},
"accountDetails": {
"margin": [
0,
2,
0,
2
]
},
"clientDetails": {
"margin": [
100,
2,
0,
2
]
},
"notesAndTerms": {
"margin": [
0,
2,
0,
5
]
},
"accountAddress": {
"margin": [
0,
2,
0,
2
]
},
"odd": {
"fillColor": "#fbfbfb"
},
"productKey": {
"color": "$primaryColor:#37a3c6",
"bold": true
},
"subtotalsBalanceDueLabel": {
"fontSize": 18
},
"subtotalsBalanceDue": {
"fontSize": 18,
"color": "$primaryColor:#37a3c6"
},
"invoiceNumber": {
"bold": true,
"fontSize": 22
},
"invoiceNumberLabel": {
"bold": true,
"fontSize": 22
},
"invoiceDate": {
"color": "#848484",
"fontSize": 13
},
"invoiceDateLabel": {
"color": "#848484",
"fontSize": 13
},
"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,
"fontSize": 11
},
"cost": {
"alignment": "right"
},
"quantity": {
"alignment": "left"
},
"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
]
}
}
Footer
[
{
"canvas": [
{
"type": "line",
"x1": 0,
"y1": 58,
"x2": 68,
"y2": 58,
"lineWidth": 6,
"lineColor": "#A9D0F5"
}
]
},
{
"canvas": [
{
"type": "line",
"x1": 68,
"y1": 0,
"x2": 135,
"y2": 0,
"lineWidth": 6,
"lineColor": "#2ECCFA"
}
]
},
{
"canvas": [
{
"type": "line",
"x1": 135,
"y1": 0,
"x2": 201,
"y2": 0,
"lineWidth": 6,
"lineColor": "#0080FF"
}
]
},
{
"canvas": [
{
"type": "line",
"x1": 201,
"y1": 0,
"x2": 267,
"y2": 0,
"lineWidth": 6,
"lineColor": "#58ACFA"
}
]
},
{
"canvas": [
{
"type": "line",
"x1": 267,
"y1": 0,
"x2": 333,
"y2": 0,
"lineWidth": 6,
"lineColor": "#A9D0F5"
}
]
},
{
"canvas": [
{
"type": "line",
"x1": 333,
"y1": 0,
"x2": 399,
"y2": 0,
"lineWidth": 6,
"lineColor": "#2ECCFA"
}
]
},
{
"canvas": [
{
"type": "line",
"x1": 399,
"y1": 0,
"x2": 465,
"y2": 0,
"lineWidth": 6,
"lineColor": "#58ACFA"
}
]
},
{
"canvas": [
{
"type": "line",
"x1": 465,
"y1": 0,
"x2": 532,
"y2": 0,
"lineWidth": 6,
"lineColor": "#0080FF"
}
]
},
{
"canvas": [
{
"type": "line",
"x1": 532,
"y1": 0,
"x2": 600,
"y2": 0,
"lineWidth": 6,
"lineColor": "#A9D0F5"
}
]
},
{
"columns": [
{
"text": [
{
"text": "Ingresos o Transferencias: ",
"italics": true,
"color": "#6E6E6E"
},
{
"text": " ES43 0019 0422 2940 1003 4700 (Deutsche Bank)\n",
"bold": true,
"italics": true
},
{
"text": " La posesión de esta factura no indica el pago de la misma sin el justificante que así lo acredite.\n",
"italics": true,
"color": "#6E6E6E"
},
{
"text": "GARANTIAS SEGUN CONDICIONES ESTABLECIDAS POR EL FABRICANTE\n\n\n",
"italics": true,
"bold": true
},
{
"text": "Salvador Angosto Navarro | NIF. 23036001Y\n",
"color": "#BDBDBD"
},
{
"text": "C/Antonio Eslava, 66 - 30393 Cartagena, Murcia\n",
"color": "#BDBDBD"
},
{
"text": "www.tecnomursistemas.com | [email protected]",
"color": "#BDBDBD"
}
],
"alignment": "center"
}
],
"margin": [
40,
-130,
40,
0
]
}
]
Wow, great design!
Try increasing the last value on the Margins tab, you may need to adjust the footer as a result of the change.
FYI… if you aren’t using the ‘Description’ field you can remove it on /settings/invoice_design#invoice_fields
Thank you for your quick response again, now it looks good. One of the things that I can not do, and that I can not find in the forum, is how to leave only the value of Total without appearing at 0, once the invoice is labeled as paid.
I’m not sure I understand “leave only the value of Total without appearing at 0”, but…
You can replace $subtotals with $subtotalsWithoutBalance (as in the business design) and then add $invoice.amount instead of the balance to always show the invoice total. It may be a bit tricky but you seem to have figured out pdfmake pretty well.
Yes, that only shows the Total of the invoice even if it is paid.
Could you be a little more precise where do I have to make that change over my previous code? I can not do it.
Sorry for my clumsiness.
If you replace $subtotals with $subtotalsWithoutBalance it should remove the total, you then need to add the field back manually. Where exactly are you getting stuck?
What I want is that this line does not appear, if I do what you tell me, it still comes out once paid.
Try removing this code:
{
"canvas": [
{
"type": "rect",
"x": 333,
"y": 50,
"w": 185,
"h": 32,
"r": 10,
"lineWidth": 1,
"color": "#E0ECF8"
}
],
"width": 5,
"margin": [
0,
0,
0,
0
]
},
ough, sorry but I think I’m driving you crazy. I am referring to the paid text line (“Pagado”). I only want the sub-total, with the taxes and the TOTAL.
Thanks, I understand now. We don’t currently support removing it.
Supported by Invoice Ninja and Event Schedule