Cloned Invoice Template to all places with Invoices and Quotes

This commit is contained in:
johnnyq
2021-04-06 21:25:25 -04:00
parent 04599c000d
commit 5cae50578d
2 changed files with 762 additions and 685 deletions
+380 -346
View File
@@ -247,363 +247,397 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
</div> </div>
<script src='plugins/pdfmake/pdfmake.js'></script> <script src='plugins/pdfmake/pdfmake.js'></script>
<script src='plugins/pdfmake/vfs_fonts.js'></script> <script src='plugins/pdfmake/vfs_fonts.js'></script>
<script>
<script> var docDefinition = {
info: {
title: '<?php echo "$company_name - Quote"; ?>',
author: '<?php echo $company_name; ?>'
},
footer: {
columns: [
{
text: <?php echo json_encode($config_quote_footer); ?>,
style: 'documentFooterCenter'
},
]
},
// Invoice markup //watermark: {text: '<?php echo $quote_status; ?>', color: 'lightgrey', opacity: 0.3, bold: true, italics: false},
// Author: Max Kostinevich
// BETA (no styles)
// http://pdfmake.org/playground.html
// playground requires you to assign document definition to a variable called dd
// CodeSandbox Example: https://codesandbox.io/s/pdfmake-invoice-oj81y content: [
// Header
{
columns: [
<?php if(!empty($company_logo_base64)){ ?>
{
image: '<?php echo "data:image;base64,$company_logo_base64"; ?>',
width: 120
},
<?php } ?>
[
{
text: 'Quote',
style: 'invoiceTitle',
width: '*'
},
{
text: '<?php echo "$quote_prefix$quote_number"; ?>',
style: 'invoiceNumber',
width: '*'
},
],
],
},
// Billing Headers
{
columns: [
{
text: <?php echo json_encode($company_name); ?>,
style:'invoiceBillingTitle',
},
{
text: <?php echo json_encode($client_name); ?>,
style:'invoiceBillingTitleClient',
},
]
},
// Billing Address
{
columns: [
{
text: <?php echo json_encode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website"); ?>,
style: 'invoiceBillingAddress'
},
{
text: <?php echo json_encode("$client_address \n $client_city $client_state $client_zip \n $client_email \n $client_phone"); ?>,
style: 'invoiceBillingAddressClient'
},
]
},
//Invoice Dates Table
{
table: {
// headers are automatically repeated if the table spans over multiple pages
// you can declare how many rows should be treated as headers
headerRows: 0,
widths: [ '*',80, 80 ],
var docDefinition = { body: [
info: { // Total
title: '<?php echo "$company_name - Quote"; ?>', [
author: '<?php echo $company_name; ?>' {
}, text:'',
rowSpan: 2
},
{},
{},
],
[
{},
{
text:'Quote Date',
style:'invoiceDateTitle',
},
{
text:'<?php echo $quote_date ?>',
style:'invoiceDateValue',
},
],
]
}, // table
layout: 'lightHorizontalLines'
},
// Line breaks
'\n\n',
// Items
{
table: {
// headers are automatically repeated if the table spans over multiple pages
// you can declare how many rows should be treated as headers
headerRows: 1,
widths: [ '*', 40, 'auto', 'auto', 80 ],
body: [
// Table Header
[
{
text: 'Product',
style: [ 'itemsHeader', 'left']
},
{
text: 'Qty',
style: [ 'itemsHeader', 'center']
},
{
text: 'Price',
style: [ 'itemsHeader', 'right']
},
{
text: 'Tax',
style: [ 'itemsHeader', 'right']
},
{
text: 'Total',
style: [ 'itemsHeader', 'right']
}
],
// Items
<?php
$total_tax = 0;
$sub_total = 0;
footer: { $sql_invoice_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE quote_id = $quote_id ORDER BY item_id ASC");
columns: [
{ text: '<?php echo $config_quote_footer; ?>', style: 'documentFooterCenter' }, while($row = mysqli_fetch_array($sql_invoice_items)){
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
$tax_id = $row['tax_id'];
$total_tax = $item_tax + $total_tax;
$total_tax = number_format($total_tax,2);
$sub_total = $item_price * $item_quantity + $sub_total;
$sub_total = number_format($sub_total, 2);
?>
] // Item
}, [
[
{
text: <?php echo json_encode($item_name); ?>,
style:'itemTitle'
},
{
text: <?php echo json_encode($item_description); ?>,
style:'itemDescription'
}
],
{
text:'<?php echo $item_quantity; ?>',
style:'itemQty'
},
{
text:'$<?php echo $item_price; ?>',
style:'itemNumber'
},
{
text:'$<?php echo $item_tax; ?>',
style:'itemNumber'
},
{
text: '$<?php echo $item_total; ?>',
style:'itemNumber'
}
],
watermark: {text: '<?php echo $quote_status; ?>', color: 'grey', opacity: 0.3, bold: true, italics: false}, <?php
}
?>
// END Items
]
}, // table
layout: 'lightHorizontalLines'
},
// TOTAL
{
table: {
// headers are automatically repeated if the table spans over multiple pages
// you can declare how many rows should be treated as headers
headerRows: 0,
widths: [ '*','auto', 80 ],
content: [ body: [
// Header // Total
{ [
columns: [ {
<?php if(!empty($company_logo_base64)){ ?> text: 'Notes',
{ style:'notesTitle'
image: '<?php echo "data:image;base64,$company_logo_base64"; ?>', },
width: 120 {},
}, {}
<?php } ?> ],
[
[ {
{ rowSpan: 3,
text: 'QUOTE', text: <?php echo json_encode($quote_note); ?>,
style: 'invoiceTitle', style:'notesText'
width: '*' },
}, {
{ text:'Subtotal',
stack: [ style:'itemsFooterSubTitle'
{ },
columns: [ {
{ text:'$<?php echo $sub_total; ?>',
text:'<?php echo "$quote_prefix$quote_number"; ?>', style:'itemsFooterSubValue'
style:'invoiceSubValue', }
width: '*' ],
[
}, {},
] {
}, text:'Tax',
{ style:'itemsFooterSubTitle'
columns: [ },
{ {
text:'<?php echo $quote_date ?>', text: '$<?php echo number_format($total_tax,2); ?>',
style:'invoiceSubValue', style:'itemsFooterSubValue'
width: '*' }
} ],
] [
}, {},
] {
} text:'Total',
], style:'itemsFooterSubTitle'
], },
}, {
// Billing Headers text: '$<?php echo number_format($quote_amount,2); ?>',
{ style:'itemsFooterSubValue'
columns: [ }
{ ],
text: '<?php echo $company_name; ?>', ]
style:'invoiceBillingTitle', }, // table
layout: 'lightHorizontalLines'
}, }
{ ], //End Content,
text: '<?php echo $client_name; ?>', styles: {
style:'invoiceBillingTitle', // Document Footer
documentFooterCenter: {
}, fontSize: 9,
] margin: [10,10,10,10],
}, alignment:'center'
},
{ // Invoice Title
columns: [ invoiceTitle: {
{ fontSize: 18,
text: '<?php echo $company_address; ?> \n <?php echo "$company_city $company_state $company_zip"; ?> \n \n <?php echo $company_phone; ?> \n <?php echo $company_website; ?>', bold: true,
style: 'invoiceBillingAddress' alignment:'right',
}, margin:[0,0,0,3]
{ },
text: '<?php echo $client_address; ?> \n <?php echo "$client_city $client_state $client_zip"; ?> \n \n <?php echo $client_email; ?> \n <?php echo $client_phone; ?>', // Invoice Number
style: 'invoiceBillingAddress' invoiceNumber: {
}, fontSize: 14,
] alignment:'right'
}, },
// Line breaks // Billing Headers
'\n\n', invoiceBillingTitle: {
// Items fontSize: 14,
{ bold: true,
table: { alignment:'left',
// headers are automatically repeated if the table spans over multiple pages margin:[0,20,0,5]
// you can declare how many rows should be treated as headers },
headerRows: 1, invoiceBillingTitleClient: {
widths: [ '*', 40, 'auto', 'auto', 80 ], fontSize: 14,
bold: true,
body: [ alignment:'right',
// Table Header margin:[0,20,0,5]
[ },
{ // Billing Details
text: 'Product', invoiceBillingAddress: {
style: 'itemsHeader' fontSize: 10,
}, lineHeight: 1.2
{ },
text: 'Qty', invoiceBillingAddressClient: {
style: [ 'itemsHeader', 'center'] fontSize: 10,
}, lineHeight: 1.2,
{ alignment:'right',
text: 'Price', margin:[0,0,0,30]
style: [ 'itemsHeader', 'center'] },
}, // Invoice Dates
{ invoiceDateTitle: {
text: 'Tax', fontSize: 10,
style: [ 'itemsHeader', 'center'] alignment:'left',
}, margin:[0,5,0,5]
{ },
text: 'Total', invoiceDateValue: {
style: [ 'itemsHeader', 'center'] fontSize: 10,
} alignment:'right',
], margin:[0,5,0,5]
// Items },
<?php // Items Header
$total_tax = 0; itemsHeader: {
$sub_total = 0; fontSize: 10,
margin: [0,5,0,5],
$sql_invoice_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE quote_id = $quote_id ORDER BY item_id ASC"); bold: true,
alignment:'right'
while($row = mysqli_fetch_array($sql_invoice_items)){ },
$item_name = $row['item_name']; // Item Title
$item_description = $row['item_description']; itemTitle: {
$item_quantity = $row['item_quantity']; fontSize: 10,
$item_price = $row['item_price']; bold: true,
$item_subtotal = $row['item_price']; margin: [0,5,0,3]
$item_tax = $row['item_tax']; },
$item_total = $row['item_total']; itemDescription: {
$tax_id = $row['tax_id']; italics: true,
$total_tax = $item_tax + $total_tax; fontSize: 9,
$total_tax = number_format($total_tax,2); lineHeight: 1.1,
$sub_total = $item_price * $item_quantity + $sub_total; margin: [0,3,0,5]
$sub_total = number_format($sub_total, 2); },
echo " itemQty: {
fontSize: 10,
// Item 1 margin: [0,5,0,5],
[ alignment: 'center',
[ },
{ itemNumber: {
text: '$item_name', fontSize: 10,
style:'itemTitle' margin: [0,5,0,5],
}, alignment: 'right',
{ },
text: '$item_description', itemTotal: {
style:'itemSubTitle' fontSize: 10,
margin: [0,5,0,5],
} bold: true,
], alignment: 'right',
{ },
text:'$item_quantity', // Items Footer (Subtotal, Total, Tax, etc)
style:'itemNumber' itemsFooterSubTitle: {
}, fontSize: 10,
{ margin: [0,5,0,5],
text:'$$item_price', alignment:'right',
style:'itemNumber' },
}, itemsFooterSubValue: {
{ fontSize: 10,
text:'$$item_tax', margin: [0,5,0,5],
style:'itemNumber' bold: false,
}, alignment:'right',
{ },
text: '$$item_total', itemsFooterTotalTitle: {
style:'itemTotal' fontSize: 10,
} margin: [0,5,0,5],
], bold: true,
alignment:'right',
"; },
itemsFooterTotalValue: {
} fontSize: 10,
margin: [0,5,0,5],
?> bold: true,
alignment:'right',
// END Items },
] notesTitle: {
}, // table fontSize: 10,
// layout: 'lightHorizontalLines' bold: true,
}, margin: [0,5,0,5],
// TOTAL },
{ notesText: {
table: { fontSize: 9,
// headers are automatically repeated if the table spans over multiple pages margin: [0,5,50,5]
// you can declare how many rows should be treated as headers },
headerRows: 0, left: {
widths: [ '*', 80 ], alignment:'left',
},
body: [ center: {
// Total alignment:'center',
[ },
{ },
text:'Subtotal', defaultStyle: {
style:'itemsFooterSubTitle' columnGap: 20,
}, }
{ }
text:'$<?php echo $sub_total; ?>', </script>
style:'itemsFooterSubValue'
}
],
[
{
text:'Tax',
style:'itemsFooterSubTitle'
},
{
text: '$<?php echo $total_tax; ?>',
style:'itemsFooterSubValue'
}
],
[
{
text:'TOTAL',
style:'itemsFooterTotalTitle'
},
{
text: '$<?php echo $quote_amount; ?>',
style:'itemsFooterTotalValue'
}
],
]
}, // table
layout: 'lightHorizontalLines'
},
{
text: 'NOTES',
style:'notesTitle'
},
{
text: '<?php ?>',
style:'notesText'
}
],
styles: {
// Document Footer
documentFooterCenter: {
fontSize: 10,
margin: [5,5,5,5],
alignment:'center'
},
// Invoice Title
invoiceTitle: {
fontSize: 22,
bold: true,
alignment:'right',
margin:[0,0,0,15]
},
// Invoice Details
invoiceSubTitle: {
fontSize: 12,
alignment:'right'
},
invoiceSubValue: {
fontSize: 12,
alignment:'right'
},
// Billing Headers
invoiceBillingTitle: {
fontSize: 14,
bold: true,
alignment:'left',
margin:[0,20,0,5],
},
// Billing Details
invoiceBillingDetails: {
alignment:'left'
},
invoiceBillingAddressTitle: {
margin: [0,7,0,3],
bold: true
},
invoiceBillingAddress: {
},
// Items Header
itemsHeader: {
margin: [0,5,0,5],
bold: true
},
// Item Title
itemTitle: {
bold: true,
},
itemSubTitle: {
italics: true,
fontSize: 11
},
itemNumber: {
margin: [0,5,0,5],
alignment: 'center',
},
itemTotal: {
margin: [0,5,0,5],
bold: true,
alignment: 'center',
},
// Items Footer (Subtotal, Total, Tax, etc)
itemsFooterSubTitle: {
margin: [0,5,0,5],
bold: true,
alignment:'right',
},
itemsFooterSubValue: {
margin: [0,5,0,5],
bold: true,
alignment:'center',
},
itemsFooterTotalTitle: {
margin: [0,5,0,5],
bold: true,
alignment:'right',
},
itemsFooterTotalValue: {
margin: [0,5,0,5],
bold: true,
alignment:'center',
},
notesTitle: {
fontSize: 10,
bold: true,
margin: [0,50,0,3],
},
notesText: {
fontSize: 10
},
center: {
alignment:'center',
},
},
defaultStyle: {
columnGap: 20,
}
};
</script>
<?php <?php
}else{ }else{
+376 -333
View File
@@ -396,350 +396,393 @@ include("footer.php");
<script src='plugins/pdfmake/pdfmake.js'></script> <script src='plugins/pdfmake/pdfmake.js'></script>
<script src='plugins/pdfmake/vfs_fonts.js'></script> <script src='plugins/pdfmake/vfs_fonts.js'></script>
<script> <script>
var docDefinition = { var docDefinition = {
info: { info: {
title: '<?php echo "$company_name - Quote"; ?>', title: '<?php echo "$company_name - Quote"; ?>',
author: '<?php echo $company_name; ?>' author: '<?php echo $company_name; ?>'
}, },
footer: {
columns: [
{
text: <?php echo json_encode($config_quote_footer); ?>,
style: 'documentFooterCenter'
},
]
},
//watermark: {text: '<?php echo $quote_status; ?>', color: 'lightgrey', opacity: 0.3, bold: true, italics: false},
footer: { content: [
columns: [ // Header
{
columns: [
<?php if(!empty($company_logo_base64)){ ?>
{
image: '<?php echo "data:image;base64,$company_logo_base64"; ?>',
width: 120
},
<?php } ?>
{ text: '<?php echo $config_quote_footer; ?>', style: 'documentFooterCenter' }, [
{
text: 'Quote',
style: 'invoiceTitle',
width: '*'
},
{
text: '<?php echo "$quote_prefix$quote_number"; ?>',
style: 'invoiceNumber',
width: '*'
},
],
],
},
// Billing Headers
{
columns: [
{
text: <?php echo json_encode($company_name); ?>,
style:'invoiceBillingTitle',
},
{
text: <?php echo json_encode($client_name); ?>,
style:'invoiceBillingTitleClient',
},
]
},
// Billing Address
{
columns: [
{
text: <?php echo json_encode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website"); ?>,
style: 'invoiceBillingAddress'
},
{
text: <?php echo json_encode("$client_address \n $client_city $client_state $client_zip \n $client_email \n $client_phone"); ?>,
style: 'invoiceBillingAddressClient'
},
]
},
//Invoice Dates Table
{
table: {
// headers are automatically repeated if the table spans over multiple pages
// you can declare how many rows should be treated as headers
headerRows: 0,
widths: [ '*',80, 80 ],
] body: [
}, // Total
[
{
text:'',
rowSpan: 2
},
{},
{},
],
[
{},
{
text:'Quote Date',
style:'invoiceDateTitle',
},
{
text:'<?php echo $quote_date ?>',
style:'invoiceDateValue',
},
],
]
}, // table
layout: 'lightHorizontalLines'
},
// Line breaks
'\n\n',
// Items
{
table: {
// headers are automatically repeated if the table spans over multiple pages
// you can declare how many rows should be treated as headers
headerRows: 1,
widths: [ '*', 40, 'auto', 'auto', 80 ],
watermark: {text: '<?php echo $quote_status; ?>', color: 'grey', opacity: 0.3, bold: true, italics: false}, body: [
// Table Header
[
{
text: 'Product',
style: [ 'itemsHeader', 'left']
},
{
text: 'Qty',
style: [ 'itemsHeader', 'center']
},
{
text: 'Price',
style: [ 'itemsHeader', 'right']
},
{
text: 'Tax',
style: [ 'itemsHeader', 'right']
},
{
text: 'Total',
style: [ 'itemsHeader', 'right']
}
],
// Items
<?php
$total_tax = 0;
$sub_total = 0;
content: [ $sql_invoice_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE quote_id = $quote_id ORDER BY item_id ASC");
// Header
{
columns: [
<?php if(!empty($company_logo_base64)){ ?>
{
image: '<?php echo "data:image;base64,$company_logo_base64"; ?>',
width: 120
},
<?php } ?>
[ while($row = mysqli_fetch_array($sql_invoice_items)){
{ $item_name = $row['item_name'];
text: 'QUOTE', $item_description = $row['item_description'];
style: 'invoiceTitle', $item_quantity = $row['item_quantity'];
width: '*' $item_price = $row['item_price'];
}, $item_subtotal = $row['item_price'];
{ $item_tax = $row['item_tax'];
stack: [ $item_total = $row['item_total'];
{ $tax_id = $row['tax_id'];
columns: [ $total_tax = $item_tax + $total_tax;
{ $total_tax = number_format($total_tax,2);
text:'<?php echo "$quote_prefix$quote_number"; ?>', $sub_total = $item_price * $item_quantity + $sub_total;
style:'invoiceSubValue', $sub_total = number_format($sub_total, 2);
width: '*' ?>
}, // Item
] [
}, [
{ {
columns: [ text: <?php echo json_encode($item_name); ?>,
{ style:'itemTitle'
text:'<?php echo $quote_date ?>', },
style:'invoiceSubValue', {
width: '*' text: <?php echo json_encode($item_description); ?>,
} style:'itemDescription'
] }
}, ],
] {
} text:'<?php echo $item_quantity; ?>',
], style:'itemQty'
], },
}, {
// Billing Headers text:'$<?php echo $item_price; ?>',
{ style:'itemNumber'
columns: [ },
{ {
text: '<?php echo $company_name; ?>', text:'$<?php echo $item_tax; ?>',
style:'invoiceBillingTitle', style:'itemNumber'
},
{
text: '$<?php echo $item_total; ?>',
style:'itemNumber'
}
],
}, <?php
{ }
text: '<?php echo $client_name; ?>', ?>
style:'invoiceBillingTitle', // END Items
]
}, }, // table
] layout: 'lightHorizontalLines'
}, },
// TOTAL
{ {
columns: [ table: {
{ // headers are automatically repeated if the table spans over multiple pages
text: '<?php echo $company_address; ?> \n <?php echo "$company_city $company_state $company_zip"; ?> \n \n <?php echo $company_phone; ?> \n <?php echo $company_website; ?>', // you can declare how many rows should be treated as headers
style: 'invoiceBillingAddress' headerRows: 0,
}, widths: [ '*','auto', 80 ],
{
text: '<?php echo $client_address; ?> \n <?php echo "$client_city $client_state $client_zip"; ?> \n \n <?php echo $client_email; ?> \n <?php echo $client_phone; ?>',
style: 'invoiceBillingAddress'
},
]
},
// Line breaks
'\n\n',
// Items
{
table: {
// headers are automatically repeated if the table spans over multiple pages
// you can declare how many rows should be treated as headers
headerRows: 1,
widths: [ '*', 40, 'auto', 'auto', 80 ],
body: [
// Table Header
[
{
text: 'Product',
style: 'itemsHeader'
},
{
text: 'Qty',
style: [ 'itemsHeader', 'center']
},
{
text: 'Price',
style: [ 'itemsHeader', 'center']
},
{
text: 'Tax',
style: [ 'itemsHeader', 'center']
},
{
text: 'Total',
style: [ 'itemsHeader', 'center']
}
],
// Items
<?php
$total_tax = 0;
$sub_total = 0;
$sql_invoice_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE quote_id = $quote_id ORDER BY item_id ASC");
while($row = mysqli_fetch_array($sql_invoice_items)){
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
$tax_id = $row['tax_id'];
$total_tax = $item_tax + $total_tax;
$total_tax = number_format($total_tax,2);
$sub_total = $item_price * $item_quantity + $sub_total;
$sub_total = number_format($sub_total, 2);
echo "
// Item 1
[
[
{
text: '$item_name',
style:'itemTitle'
},
{
text: '$item_description',
style:'itemSubTitle'
}
],
{
text:'$item_quantity',
style:'itemNumber'
},
{
text:'$$item_price',
style:'itemNumber'
},
{
text:'$$item_tax',
style:'itemNumber'
},
{
text: '$$item_total',
style:'itemTotal'
}
],
";
}
?>
// END Items
]
}, // table
// layout: 'lightHorizontalLines'
},
// TOTAL
{
table: {
// headers are automatically repeated if the table spans over multiple pages
// you can declare how many rows should be treated as headers
headerRows: 0,
widths: [ '*', 80 ],
body: [
// Total
[
{
text:'Subtotal',
style:'itemsFooterSubTitle'
},
{
text:'$<?php echo $sub_total; ?>',
style:'itemsFooterSubValue'
}
],
[
{
text:'Tax',
style:'itemsFooterSubTitle'
},
{
text: '$<?php echo $total_tax; ?>',
style:'itemsFooterSubValue'
}
],
[
{
text:'TOTAL',
style:'itemsFooterTotalTitle'
},
{
text: '$<?php echo $quote_amount; ?>',
style:'itemsFooterTotalValue'
}
],
]
}, // table
layout: 'lightHorizontalLines'
},
{
text: 'NOTES',
style:'notesTitle'
},
{
text: '<?php ?>',
style:'notesText'
}
],
styles: {
// Document Footer
documentFooterCenter: {
fontSize: 10,
margin: [5,5,5,5],
alignment:'center'
},
// Invoice Title
invoiceTitle: {
fontSize: 22,
bold: true,
alignment:'right',
margin:[0,0,0,15]
},
// Invoice Details
invoiceSubTitle: {
fontSize: 12,
alignment:'right'
},
invoiceSubValue: {
fontSize: 12,
alignment:'right'
},
// Billing Headers
invoiceBillingTitle: {
fontSize: 14,
bold: true,
alignment:'left',
margin:[0,20,0,5],
},
// Billing Details
invoiceBillingDetails: {
alignment:'left'
},
invoiceBillingAddressTitle: {
margin: [0,7,0,3],
bold: true
},
invoiceBillingAddress: {
},
// Items Header
itemsHeader: {
margin: [0,5,0,5],
bold: true
},
// Item Title
itemTitle: {
bold: true,
},
itemSubTitle: {
italics: true,
fontSize: 11
},
itemNumber: {
margin: [0,5,0,5],
alignment: 'center',
},
itemTotal: {
margin: [0,5,0,5],
bold: true,
alignment: 'center',
},
// Items Footer (Subtotal, Total, Tax, etc)
itemsFooterSubTitle: {
margin: [0,5,0,5],
bold: true,
alignment:'right',
},
itemsFooterSubValue: {
margin: [0,5,0,5],
bold: true,
alignment:'center',
},
itemsFooterTotalTitle: {
margin: [0,5,0,5],
bold: true,
alignment:'right',
},
itemsFooterTotalValue: {
margin: [0,5,0,5],
bold: true,
alignment:'center',
},
notesTitle: {
fontSize: 10,
bold: true,
margin: [0,50,0,3],
},
notesText: {
fontSize: 10
},
center: {
alignment:'center',
},
},
defaultStyle: {
columnGap: 20,
}
};
body: [
// Total
[
{
text: 'Notes',
style:'notesTitle'
},
{},
{}
],
[
{
rowSpan: 3,
text: <?php echo json_encode($quote_note); ?>,
style:'notesText'
},
{
text:'Subtotal',
style:'itemsFooterSubTitle'
},
{
text:'$<?php echo $sub_total; ?>',
style:'itemsFooterSubValue'
}
],
[
{},
{
text:'Tax',
style:'itemsFooterSubTitle'
},
{
text: '$<?php echo number_format($total_tax,2); ?>',
style:'itemsFooterSubValue'
}
],
[
{},
{
text:'Total',
style:'itemsFooterSubTitle'
},
{
text: '$<?php echo number_format($quote_amount,2); ?>',
style:'itemsFooterSubValue'
}
],
]
}, // table
layout: 'lightHorizontalLines'
}
], //End Content,
styles: {
// Document Footer
documentFooterCenter: {
fontSize: 9,
margin: [10,10,10,10],
alignment:'center'
},
// Invoice Title
invoiceTitle: {
fontSize: 18,
bold: true,
alignment:'right',
margin:[0,0,0,3]
},
// Invoice Number
invoiceNumber: {
fontSize: 14,
alignment:'right'
},
// Billing Headers
invoiceBillingTitle: {
fontSize: 14,
bold: true,
alignment:'left',
margin:[0,20,0,5]
},
invoiceBillingTitleClient: {
fontSize: 14,
bold: true,
alignment:'right',
margin:[0,20,0,5]
},
// Billing Details
invoiceBillingAddress: {
fontSize: 10,
lineHeight: 1.2
},
invoiceBillingAddressClient: {
fontSize: 10,
lineHeight: 1.2,
alignment:'right',
margin:[0,0,0,30]
},
// Invoice Dates
invoiceDateTitle: {
fontSize: 10,
alignment:'left',
margin:[0,5,0,5]
},
invoiceDateValue: {
fontSize: 10,
alignment:'right',
margin:[0,5,0,5]
},
// Items Header
itemsHeader: {
fontSize: 10,
margin: [0,5,0,5],
bold: true,
alignment:'right'
},
// Item Title
itemTitle: {
fontSize: 10,
bold: true,
margin: [0,5,0,3]
},
itemDescription: {
italics: true,
fontSize: 9,
lineHeight: 1.1,
margin: [0,3,0,5]
},
itemQty: {
fontSize: 10,
margin: [0,5,0,5],
alignment: 'center',
},
itemNumber: {
fontSize: 10,
margin: [0,5,0,5],
alignment: 'right',
},
itemTotal: {
fontSize: 10,
margin: [0,5,0,5],
bold: true,
alignment: 'right',
},
// Items Footer (Subtotal, Total, Tax, etc)
itemsFooterSubTitle: {
fontSize: 10,
margin: [0,5,0,5],
alignment:'right',
},
itemsFooterSubValue: {
fontSize: 10,
margin: [0,5,0,5],
bold: false,
alignment:'right',
},
itemsFooterTotalTitle: {
fontSize: 10,
margin: [0,5,0,5],
bold: true,
alignment:'right',
},
itemsFooterTotalValue: {
fontSize: 10,
margin: [0,5,0,5],
bold: true,
alignment:'right',
},
notesTitle: {
fontSize: 10,
bold: true,
margin: [0,5,0,5],
},
notesText: {
fontSize: 9,
margin: [0,5,50,5]
},
left: {
alignment:'left',
},
center: {
alignment:'center',
},
},
defaultStyle: {
columnGap: 20,
}
}
</script> </script>