mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix 'balance due' PDF styling
This commit is contained in:
parent
661028b4e7
commit
587acbe098
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -595,8 +595,8 @@ NINJA.invoiceDocuments = function(invoice) {
|
|||||||
NINJA.statementSubtotals = function(invoice)
|
NINJA.statementSubtotals = function(invoice)
|
||||||
{
|
{
|
||||||
var data = [[
|
var data = [[
|
||||||
{ text: invoiceLabels.balance_due, style: ['subtotalsLabel', 'balanceDueLabel'] },
|
{ text: invoiceLabels.balance_due, style: ['subtotalsLabel', 'subtotalsBalanceDueLabel'] },
|
||||||
{ text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['subtotals', 'balanceDue'] }
|
{ text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['subtotals', 'subtotalsBalanceDue'] }
|
||||||
]];
|
]];
|
||||||
|
|
||||||
return NINJA.prepareDataPairs(data, 'subtotals');
|
return NINJA.prepareDataPairs(data, 'subtotals');
|
||||||
@ -662,16 +662,16 @@ NINJA.subtotals = function(invoice, hideBalance)
|
|||||||
|
|
||||||
if (!hideBalance || isPartial) {
|
if (!hideBalance || isPartial) {
|
||||||
data.push([
|
data.push([
|
||||||
{ text: invoice.is_quote || invoice.balance_amount < 0 ? invoiceLabels.total : invoiceLabels.balance_due, style: ['subtotalsLabel', isPartial ? '' : 'balanceDueLabel'] },
|
{ 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 ? '' : 'balanceDue'] }
|
{ text: formatMoneyInvoice(invoice.total_amount, invoice), style: ['subtotals', isPartial ? '' : 'subtotalsBalanceDue'] }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hideBalance) {
|
if (!hideBalance) {
|
||||||
if (isPartial) {
|
if (isPartial) {
|
||||||
data.push([
|
data.push([
|
||||||
{ text: invoiceLabels.partial_due, style: ['subtotalsLabel', 'balanceDueLabel'] },
|
{ text: invoiceLabels.partial_due, style: ['subtotalsLabel', 'subtotalsBalanceDueLabel'] },
|
||||||
{ text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['subtotals', 'balanceDue'] }
|
{ text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['subtotals', 'subtotalsBalanceDue'] }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -682,8 +682,8 @@ NINJA.subtotals = function(invoice, hideBalance)
|
|||||||
NINJA.subtotalsBalance = function(invoice) {
|
NINJA.subtotalsBalance = function(invoice) {
|
||||||
var isPartial = NINJA.parseFloat(invoice.partial);
|
var isPartial = NINJA.parseFloat(invoice.partial);
|
||||||
return [[
|
return [[
|
||||||
{text: isPartial ? invoiceLabels.partial_due : (invoice.is_quote || invoice.balance_amount < 0 ? invoiceLabels.total : invoiceLabels.balance_due), style:['subtotalsLabel', 'balanceDueLabel']},
|
{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', 'balanceDue']}
|
{text: formatMoneyInvoice(invoice.balance_amount, invoice), style:['subtotals', 'subtotalsBalanceDue']}
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,11 +171,11 @@
|
|||||||
"productKey": {
|
"productKey": {
|
||||||
"color": "$primaryColor:#36a498"
|
"color": "$primaryColor:#36a498"
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"bold": true
|
"bold": true
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color": "$primaryColor:#36a498",
|
"color": "$primaryColor:#36a498",
|
||||||
"bold": true
|
"bold": true
|
||||||
|
@ -159,12 +159,12 @@
|
|||||||
"productKey": {
|
"productKey": {
|
||||||
"bold": true
|
"bold": true
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color": "#ffffff",
|
"color": "#ffffff",
|
||||||
"bold": true
|
"bold": true
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"bold": true,
|
"bold": true,
|
||||||
"color":"#ffffff",
|
"color":"#ffffff",
|
||||||
|
@ -144,10 +144,10 @@
|
|||||||
"color": "$primaryColor:#37a3c6",
|
"color": "$primaryColor:#37a3c6",
|
||||||
"bold": true
|
"bold": true
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fontSize": "$fontSizeLarger"
|
"fontSize": "$fontSizeLarger"
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fontSize": "$fontSizeLarger",
|
"fontSize": "$fontSizeLarger",
|
||||||
"color": "$primaryColor:#37a3c6"
|
"color": "$primaryColor:#37a3c6"
|
||||||
},
|
},
|
||||||
|
@ -84,11 +84,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "$balanceDueLabel",
|
"text": "$balanceDueLabel",
|
||||||
"style": "balanceDueLabel"
|
"style": "subtotalsBalanceDueLabel"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "$balanceDue",
|
"text": "$balanceDue",
|
||||||
"style": "balanceDue"
|
"style": "subtotalsBalanceDue"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"stack": [
|
"stack": [
|
||||||
@ -131,11 +131,11 @@
|
|||||||
"productKey": {
|
"productKey": {
|
||||||
"bold": true
|
"bold": true
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"margin": [320,20,0,0]
|
"margin": [320,20,0,0]
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color": "$primaryColor:#AE1E54",
|
"color": "$primaryColor:#AE1E54",
|
||||||
"bold": true,
|
"bold": true,
|
||||||
|
@ -86,11 +86,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "$balanceDueLabel",
|
"text": "$balanceDueLabel",
|
||||||
"style": "balanceDueLabel"
|
"style": "subtotalsBalanceDueLabel"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "$balanceDue",
|
"text": "$balanceDue",
|
||||||
"style": "balanceDue"
|
"style": "subtotalsBalanceDue"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"canvas": [{ "type": "line", "x1": 270, "y1": 20, "x2": 515, "y2": 20, "lineWidth": 1,"dash": { "length": 2 }}]
|
"canvas": [{ "type": "line", "x1": 270, "y1": 20, "x2": 515, "y2": 20, "lineWidth": 1,"dash": { "length": 2 }}]
|
||||||
@ -136,12 +136,12 @@
|
|||||||
},
|
},
|
||||||
"odd": {
|
"odd": {
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color": "$primaryColor:#5a7b61",
|
"color": "$primaryColor:#5a7b61",
|
||||||
"margin": [320,20,0,0]
|
"margin": [320,20,0,0]
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color": "$primaryColor:#5a7b61",
|
"color": "$primaryColor:#5a7b61",
|
||||||
"style": true,
|
"style": true,
|
||||||
|
@ -140,11 +140,11 @@
|
|||||||
"clientName": {
|
"clientName": {
|
||||||
"bold": true
|
"bold": true
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"bold": true
|
"bold": true
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color": "$primaryColor:#bc9f2b",
|
"color": "$primaryColor:#bc9f2b",
|
||||||
"bold": true
|
"bold": true
|
||||||
|
@ -75,13 +75,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "$balanceDueLabel",
|
"text": "$balanceDueLabel",
|
||||||
"style": "balanceDueLabel",
|
"style": "subtotalsBalanceDueLabel",
|
||||||
"margin": [0, 16, 0, 0],
|
"margin": [0, 16, 0, 0],
|
||||||
"width": 370
|
"width": 370
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "$balanceDue",
|
"text": "$balanceDue",
|
||||||
"style": "balanceDue",
|
"style": "subtotalsBalanceDue",
|
||||||
"margin": [0, 16, 8, 0]
|
"margin": [0, 16, 8, 0]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -202,13 +202,13 @@
|
|||||||
"lineTotalTableHeader": {
|
"lineTotalTableHeader": {
|
||||||
"alignment": "right"
|
"alignment": "right"
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color":"#FFFFFF",
|
"color":"#FFFFFF",
|
||||||
"alignment":"right",
|
"alignment":"right",
|
||||||
"bold": true
|
"bold": true
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color":"#FFFFFF",
|
"color":"#FFFFFF",
|
||||||
"bold": true,
|
"bold": true,
|
||||||
|
@ -142,10 +142,10 @@
|
|||||||
"bold": true,
|
"bold": true,
|
||||||
"fontSize": "$fontSizeLarger"
|
"fontSize": "$fontSizeLarger"
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fontSize": "$fontSizeLargest"
|
"fontSize": "$fontSizeLargest"
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color": "$primaryColor:#cd5138"
|
"color": "$primaryColor:#cd5138"
|
||||||
},
|
},
|
||||||
|
@ -157,10 +157,10 @@
|
|||||||
"invoiceDetailBalanceDue": {
|
"invoiceDetailBalanceDue": {
|
||||||
"fillColor": "#e6e6e6"
|
"fillColor": "#e6e6e6"
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fillColor": "#e6e6e6"
|
"fillColor": "#e6e6e6"
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fillColor": "#e6e6e6"
|
"fillColor": "#e6e6e6"
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
|
@ -201,12 +201,12 @@
|
|||||||
"lineTotalTableHeader": {
|
"lineTotalTableHeader": {
|
||||||
"alignment": "right"
|
"alignment": "right"
|
||||||
},
|
},
|
||||||
"balanceDueLabel": {
|
"subtotalsBalanceDueLabel": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"color":"#FFFFFF",
|
"color":"#FFFFFF",
|
||||||
"bold": true
|
"bold": true
|
||||||
},
|
},
|
||||||
"balanceDue": {
|
"subtotalsBalanceDue": {
|
||||||
"fontSize": "$fontSizeLargest",
|
"fontSize": "$fontSizeLargest",
|
||||||
"bold": true,
|
"bold": true,
|
||||||
"color":"#FFFFFF",
|
"color":"#FFFFFF",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user