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

Fix 'balance due' PDF styling

This commit is contained in:
Hillel Coren 2017-05-14 17:18:30 +03:00
parent 661028b4e7
commit 587acbe098
13 changed files with 87 additions and 87 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

@ -595,8 +595,8 @@ NINJA.invoiceDocuments = function(invoice) {
NINJA.statementSubtotals = function(invoice)
{
var data = [[
{ text: invoiceLabels.balance_due, style: ['subtotalsLabel', 'balanceDueLabel'] },
{ text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['subtotals', 'balanceDue'] }
{ text: invoiceLabels.balance_due, style: ['subtotalsLabel', 'subtotalsBalanceDueLabel'] },
{ text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['subtotals', 'subtotalsBalanceDue'] }
]];
return NINJA.prepareDataPairs(data, 'subtotals');
@ -662,16 +662,16 @@ NINJA.subtotals = function(invoice, hideBalance)
if (!hideBalance || isPartial) {
data.push([
{ text: invoice.is_quote || invoice.balance_amount < 0 ? invoiceLabels.total : invoiceLabels.balance_due, style: ['subtotalsLabel', isPartial ? '' : 'balanceDueLabel'] },
{ text: formatMoneyInvoice(invoice.total_amount, invoice), style: ['subtotals', isPartial ? '' : 'balanceDue'] }
{ text: invoice.is_quote || invoice.balance_amount < 0 ? invoiceLabels.total : invoiceLabels.balance_due, style: ['subtotalsLabel', isPartial ? '' : 'subtotalsBalanceDueLabel'] },
{ text: formatMoneyInvoice(invoice.total_amount, invoice), style: ['subtotals', isPartial ? '' : 'subtotalsBalanceDue'] }
]);
}
if (!hideBalance) {
if (isPartial) {
data.push([
{ text: invoiceLabels.partial_due, style: ['subtotalsLabel', 'balanceDueLabel'] },
{ text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['subtotals', 'balanceDue'] }
{ text: invoiceLabels.partial_due, style: ['subtotalsLabel', 'subtotalsBalanceDueLabel'] },
{ text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['subtotals', 'subtotalsBalanceDue'] }
]);
}
}
@ -682,8 +682,8 @@ NINJA.subtotals = function(invoice, hideBalance)
NINJA.subtotalsBalance = function(invoice) {
var isPartial = NINJA.parseFloat(invoice.partial);
return [[
{text: isPartial ? invoiceLabels.partial_due : (invoice.is_quote || invoice.balance_amount < 0 ? invoiceLabels.total : invoiceLabels.balance_due), style:['subtotalsLabel', 'balanceDueLabel']},
{text: formatMoneyInvoice(invoice.balance_amount, invoice), style:['subtotals', 'balanceDue']}
{text: isPartial ? invoiceLabels.partial_due : (invoice.is_quote || invoice.balance_amount < 0 ? invoiceLabels.total : invoiceLabels.balance_due), style:['subtotalsLabel', 'subtotalsBalanceDueLabel']},
{text: formatMoneyInvoice(invoice.balance_amount, invoice), style:['subtotals', 'subtotalsBalanceDue']}
]];
}

View File

@ -171,11 +171,11 @@
"productKey": {
"color": "$primaryColor:#36a498"
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fontSize": "$fontSizeLargest",
"bold": true
},
"balanceDue": {
"subtotalsBalanceDue": {
"fontSize": "$fontSizeLargest",
"color": "$primaryColor:#36a498",
"bold": true

View File

@ -1,7 +1,7 @@
{
"content": [
{
"columns":
"columns":
[
{
"image": "$accountLogo",
@ -16,7 +16,7 @@
"width": 150,
"stack": "$accountAddress"
}
]
]
},
{
"columns": [
@ -29,12 +29,12 @@
"margin": [0, 20, 0, 0]
},
{
"canvas": [{ "type": "rect", "x": 20, "y": 0, "w": 174, "h": "$invoiceDetailsHeight","r":10, "lineWidth": 1,"color":"$primaryColor:#eb792d"}],
"canvas": [{ "type": "rect", "x": 20, "y": 0, "w": 174, "h": "$invoiceDetailsHeight","r":10, "lineWidth": 1,"color":"$primaryColor:#eb792d"}],
"width":36,
"margin":[200,25,0,0]
},
{
"table": {
"table": {
"widths": [64, 70],
"body": "$invoiceDetails"
},
@ -56,12 +56,12 @@
"vLineWidth": "$notFirst:.5",
"hLineColor": "#FFFFFF",
"vLineColor": "#FFFFFF",
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:12",
"paddingBottom": "$amount:12"
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:12",
"paddingBottom": "$amount:12"
}
},
},
{
"columns": [
"$notesAndTerms",
@ -130,7 +130,7 @@
}
],
"margin": [40, -20, 40, 0]
},
},
"defaultStyle": {
"fontSize": "$fontSize",
"margin": [8, 4, 8, 4]
@ -159,12 +159,12 @@
"productKey": {
"bold": true
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fontSize": "$fontSizeLargest",
"color": "#ffffff",
"color": "#ffffff",
"bold": true
},
"balanceDue": {
"subtotalsBalanceDue": {
"fontSize": "$fontSizeLargest",
"bold": true,
"color":"#ffffff",
@ -189,7 +189,7 @@
},
"lineTotalTableHeader": {
"alignment": "right"
},
},
"issuedTo": {
"margin": [0,2,0,1],
"bold": true,
@ -221,11 +221,11 @@
},
"subtotals": {
"alignment": "right"
},
},
"subtotalsBalance": {
"alignment": "right",
"margin": [0, -25, 0, 0]
},
},
"termsLabel": {
"bold": true,
"margin": [0, 0, 0, 4]
@ -243,4 +243,4 @@
}
},
"pageMargins": [40, 40, 40, 40]
}
}

View File

@ -144,10 +144,10 @@
"color": "$primaryColor:#37a3c6",
"bold": true
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fontSize": "$fontSizeLarger"
},
"balanceDue": {
"subtotalsBalanceDue": {
"fontSize": "$fontSizeLarger",
"color": "$primaryColor:#37a3c6"
},

View File

@ -1,6 +1,6 @@
{
"content": [
{
{
"columns": [
{
"stack": "$clientDetails"
@ -21,7 +21,7 @@
},
{
"columns": [
{"text":
{"text":
[
{"text": "$entityTypeUC", "style": "header1"},
{"text": "#", "style": "header2"},
@ -31,7 +31,7 @@
},
{
"width":200,
"table": {
"table": {
"body": "$invoiceDetails"
},
"layout": "noBorders",
@ -52,12 +52,12 @@
"hLineWidth": "$none",
"vLineWidth": "$none",
"hLineColor": "$primaryColor:#E8E8E8",
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:8",
"paddingBottom": "$amount:8"
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:8",
"paddingBottom": "$amount:8"
}
},
},
{
"columns": [
"$notesAndTerms",
@ -70,10 +70,10 @@
"layout": {
"hLineWidth": "$none",
"vLineWidth": "$none",
"paddingLeft": "$amount:34",
"paddingRight": "$amount:8",
"paddingTop": "$amount:4",
"paddingBottom": "$amount:4"
"paddingLeft": "$amount:34",
"paddingRight": "$amount:8",
"paddingTop": "$amount:4",
"paddingBottom": "$amount:4"
}
}
]
@ -84,11 +84,11 @@
},
{
"text": "$balanceDueLabel",
"style": "balanceDueLabel"
"style": "subtotalsBalanceDueLabel"
},
{
"text": "$balanceDue",
"style": "balanceDue"
"style": "subtotalsBalanceDue"
},
{
"stack": [
@ -131,11 +131,11 @@
"productKey": {
"bold": true
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fontSize": "$fontSizeLargest",
"margin": [320,20,0,0]
},
"balanceDue": {
"subtotalsBalanceDue": {
"fontSize": "$fontSizeLargest",
"color": "$primaryColor:#AE1E54",
"bold": true,
@ -165,7 +165,7 @@
},
"lineTotalTableHeader": {
"alignment": "right"
},
},
"clientName": {
"bold": true
},
@ -173,19 +173,19 @@
"margin": [0,2,0,1]
},
"header1": {
"bold": true,
"bold": true,
"margin": [0, 30, 0, 16],
"fontSize": 46
"fontSize": 46
},
"header2": {
"margin": [0, 30, 0, 16],
"fontSize": 46,
"italics": true,
"italics": true,
"color": "$primaryColor:#AE1E54"
},
"invoiceLineItemsTable": {
"margin": [0, 4, 0, 16]
},
},
"cost": {
"alignment": "right"
},
@ -200,7 +200,7 @@
},
"subtotals": {
"alignment": "right"
},
},
"termsLabel": {
"bold": true,
"margin": [0, 0, 0, 4]
@ -218,4 +218,4 @@
}
},
"pageMargins": [40, 40, 40, 40]
}
}

View File

@ -13,7 +13,7 @@
{
"width": 120,
"stack": [
{"text": "$invoiceToLabel", "style": "header", "margin": [0, 0, 0, 6]},
{"text": "$invoiceToLabel", "style": "header", "margin": [0, 0, 0, 6]},
"$clientDetails"
]
},
@ -33,15 +33,15 @@
},
{
"stack": [
{"text": "$detailsLabel", "style": "header", "margin": [0, 0, 0, 6]},
{"text": "$detailsLabel", "style": "header", "margin": [0, 0, 0, 6]},
{
"width":180,
"table": {
"table": {
"body": "$invoiceDetails"
},
"layout": "noBorders"
}
]
]
}],
"margin": [0, 20, 0, 0]
},
@ -55,12 +55,12 @@
"layout": {
"hLineWidth": "$notFirst:.5",
"vLineWidth": "$none",
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:12",
"paddingLeft": "$amount:8",
"paddingRight": "$amount:8",
"paddingTop": "$amount:12",
"paddingBottom": "$amount:12"
}
},
},
{
"columns": [
"$notesAndTerms",
@ -73,10 +73,10 @@
"layout": {
"hLineWidth": "$none",
"vLineWidth": "$none",
"paddingLeft": "$amount:34",
"paddingRight": "$amount:8",
"paddingTop": "$amount:4",
"paddingBottom": "$amount:4"
"paddingLeft": "$amount:34",
"paddingRight": "$amount:8",
"paddingTop": "$amount:4",
"paddingBottom": "$amount:4"
}
}
]
@ -86,11 +86,11 @@
},
{
"text": "$balanceDueLabel",
"style": "balanceDueLabel"
"style": "subtotalsBalanceDueLabel"
},
{
"text": "$balanceDue",
"style": "balanceDue"
"style": "subtotalsBalanceDue"
},
{
"canvas": [{ "type": "line", "x1": 270, "y1": 20, "x2": 515, "y2": 20, "lineWidth": 1,"dash": { "length": 2 }}]
@ -100,7 +100,7 @@
"$invoiceDocuments"
],
"style": "invoiceDocuments"
}],
}],
"footer": [
{
"columns": [
@ -136,22 +136,22 @@
},
"odd": {
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fontSize": "$fontSizeLargest",
"color": "$primaryColor:#5a7b61",
"margin": [320,20,0,0]
},
"balanceDue": {
"subtotalsBalanceDue": {
"fontSize": "$fontSizeLargest",
"color": "$primaryColor:#5a7b61",
"style": true,
"margin":[0,-14,8,0],
"alignment":"right"
},
},
"invoiceDetailBalanceDue": {
"color": "$primaryColor:#5a7b61",
"bold": true
},
},
"header": {
"fontSize": 14,
"bold": true
@ -172,7 +172,7 @@
},
"lineTotalTableHeader": {
"alignment": "right"
},
},
"invoiceLineItemsTable": {
"margin": [0, 40, 0, 16]
},
@ -190,7 +190,7 @@
},
"subtotals": {
"alignment": "right"
},
},
"termsLabel": {
"bold": true,
"margin": [0, 0, 0, 4]

View File

@ -140,11 +140,11 @@
"clientName": {
"bold": true
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fontSize": "$fontSizeLargest",
"bold": true
},
"balanceDue": {
"subtotalsBalanceDue": {
"fontSize": "$fontSizeLargest",
"color": "$primaryColor:#bc9f2b",
"bold": true

View File

@ -75,13 +75,13 @@
},
{
"text": "$balanceDueLabel",
"style": "balanceDueLabel",
"style": "subtotalsBalanceDueLabel",
"margin": [0, 16, 0, 0],
"width": 370
},
{
"text": "$balanceDue",
"style": "balanceDue",
"style": "subtotalsBalanceDue",
"margin": [0, 16, 8, 0]
}
]
@ -202,13 +202,13 @@
"lineTotalTableHeader": {
"alignment": "right"
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fontSize": "$fontSizeLargest",
"color":"#FFFFFF",
"alignment":"right",
"bold": true
},
"balanceDue": {
"subtotalsBalanceDue": {
"fontSize": "$fontSizeLargest",
"color":"#FFFFFF",
"bold": true,

View File

@ -142,10 +142,10 @@
"bold": true,
"fontSize": "$fontSizeLarger"
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fontSize": "$fontSizeLargest"
},
"balanceDue": {
"subtotalsBalanceDue": {
"fontSize": "$fontSizeLargest",
"color": "$primaryColor:#cd5138"
},

View File

@ -157,10 +157,10 @@
"invoiceDetailBalanceDue": {
"fillColor": "#e6e6e6"
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fillColor": "#e6e6e6"
},
"balanceDue": {
"subtotalsBalanceDue": {
"fillColor": "#e6e6e6"
},
"header": {

View File

@ -201,12 +201,12 @@
"lineTotalTableHeader": {
"alignment": "right"
},
"balanceDueLabel": {
"subtotalsBalanceDueLabel": {
"fontSize": "$fontSizeLargest",
"color":"#FFFFFF",
"bold": true
},
"balanceDue": {
"subtotalsBalanceDue": {
"fontSize": "$fontSizeLargest",
"bold": true,
"color":"#FFFFFF",