1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-23 18:01:35 +02:00
invoiceninja/public/js/templates/clean.js

192 lines
4.4 KiB
JavaScript
Raw Normal View History

2015-04-13 11:23:43 +02:00
//pdfmake
var dd = {
2015-04-13 08:02:33 +02:00
content: [
{
columns: [
2015-04-14 09:21:52 +02:00
[
invoice.image?
{
image: invoice.image,
fit: [150, 80]
}:""
],
2015-04-13 08:02:33 +02:00
{
2015-04-14 12:23:35 +02:00
stack: accountDetails(account)
2015-04-13 08:02:33 +02:00
},
{
2015-04-14 12:23:35 +02:00
stack: accountAddress(account)
2015-04-13 08:02:33 +02:00
}
]
},
2015-04-14 12:23:35 +02:00
{
text:(invoice.is_quote ? invoiceLabels.quote : invoiceLabels.invoice).toUpperCase(),
2015-05-05 11:48:23 +02:00
margin: [8, 70, 8, 16],
style: 'primaryColor',
fontSize: 11
2015-04-14 12:23:35 +02:00
},
2015-04-13 08:02:33 +02:00
{
style: 'tableExample',
table: {
headerRows: 1,
widths: ['auto', 'auto', '*'],
2015-05-05 11:48:23 +02:00
body: [[
{
table: {
body: invoiceDetails(invoice),
},
layout: 'noBorders',
},
clientDetails(invoice),
''
]]
2015-04-13 08:02:33 +02:00
},
layout: {
hLineWidth: function (i, node) {
2015-05-05 11:48:23 +02:00
return (i === 0 || i === node.table.body.length) ? .5 : 0;
2015-04-13 08:02:33 +02:00
},
vLineWidth: function (i, node) {
return 0;//(i === 0 || i === node.table.widths.length) ? 2 : 1;
},
hLineColor: function (i, node) {
2015-04-13 14:37:42 +02:00
return '#D8D8D8';//(i === 0 || i === node.table.body.length) ? 'black' : 'gray';
2015-04-13 08:02:33 +02:00
},
/*vLineColor: function (i, node) {
return (i === 0 || i === node.table.widths.length) ? 'black' : 'gray';
},*/
2015-04-14 12:23:35 +02:00
paddingLeft: function(i, node) { return 8; },
paddingRight: function(i, node) { return 8; },
paddingTop: function(i, node) { return 4; },
paddingBottom: function(i, node) { return 4; }
2015-04-13 08:02:33 +02:00
}
},
'\n',
{
table: {
headerRows: 1,
2015-05-05 11:48:23 +02:00
widths: ['15%', '*', 'auto', 'auto', 'auto', 'auto'],
2015-04-13 14:37:42 +02:00
body:invoiceLines(invoice),
},
layout: {
hLineWidth: function (i, node) {
2015-05-05 11:48:23 +02:00
return i === 0 ? 0 : .5;
2015-04-13 14:37:42 +02:00
},
vLineWidth: function (i, node) {
return 0;
},
hLineColor: function (i, node) {
return '#D8D8D8';
2015-04-14 12:23:35 +02:00
},
paddingLeft: function(i, node) { return 8; },
paddingRight: function(i, node) { return 8; },
paddingTop: function(i, node) { return 8; },
paddingBottom: function(i, node) { return 8; }
2015-04-13 08:02:33 +02:00
},
2015-04-14 09:04:58 +02:00
},
'\n',
2015-04-13 22:45:09 +02:00
{
2015-04-14 12:23:35 +02:00
columns: [
notesAndTerms(invoice),
{
style: 'subtotals',
table: {
widths: ['*', '*'],
body: subtotals(invoice),
},
layout: {
hLineWidth: function (i, node) {
return 0;
},
vLineWidth: function (i, node) {
return 0;
},
paddingLeft: function(i, node) { return 8; },
paddingRight: function(i, node) { return 8; },
paddingTop: function(i, node) { return 4; },
paddingBottom: function(i, node) { return 4; }
},
}
]
2015-04-13 22:45:09 +02:00
},
2015-04-13 08:02:33 +02:00
],
2015-04-14 09:04:58 +02:00
footer: function(){
2015-05-05 11:48:23 +02:00
f = [{ text:invoice.invoice_footer?invoice.invoice_footer:"", margin: [40, 0]}]
2015-04-14 09:04:58 +02:00
if (!invoice.is_pro && logoImages.imageLogo1) {
f.push({
image: logoImages.imageLogo1,
width: 150,
2015-05-05 11:48:23 +02:00
margin: [40,0]
2015-04-14 09:04:58 +02:00
});
}
return f;
2015-04-13 23:39:08 +02:00
},
2015-04-14 09:04:58 +02:00
2015-04-13 11:23:43 +02:00
defaultStyle: {
2015-04-21 13:42:31 +02:00
//font: 'Roboto',
2015-04-14 12:23:35 +02:00
fontSize: 9,
margin: [8, 4, 8, 4]
2015-04-13 11:23:43 +02:00
},
2015-04-13 08:02:33 +02:00
styles: {
2015-04-14 12:23:35 +02:00
primaryColor:{
color: primaryColor('#299CC2')
},
2015-05-05 11:48:23 +02:00
accountName: {
margin: [4, 2, 4, 2],
color:primaryColor('#299CC2')
},
2015-04-14 12:23:35 +02:00
accountDetails: {
margin: [4, 2, 4, 2],
color: '#AAA9A9'
},
2015-04-13 08:02:33 +02:00
bold: {
bold: true
2015-04-13 14:37:42 +02:00
},
even: {
},
odd: {
fillColor:'#F4F4F4'
},
2015-04-14 12:23:35 +02:00
productKey: {
color:primaryColor('#299CC2')
},
2015-04-13 14:37:42 +02:00
cost: {
alignment: 'right'
2015-04-13 22:21:01 +02:00
},
quantity: {
alignment: 'right'
},
tax: {
alignment: 'right'
},
lineTotal: {
alignment: 'right'
2015-04-14 12:23:35 +02:00
},
right: {
alignment: 'right'
},
subtotals: {
alignment: 'right'
},
tableHeader: {
bold: true
},
balanceDueLabel: {
fontSize: 11
},
balanceDueValue: {
fontSize: 11,
color:primaryColor('#299CC2')
},
notes: {
},
terms: {
},
termsLabel: {
bold: true,
fontSize: 10,
margin: [0, 10, 0, 4]
2015-04-13 08:02:33 +02:00
}
2015-04-14 09:04:58 +02:00
},
2015-05-05 11:48:23 +02:00
pageMargins: [40, 40, 40, 40]
2015-04-13 11:23:43 +02:00
};