Sales order PDF template

The client would like to create a PDF template by clicking the print button from the sales order record.

We have customized the advanced pdf template and applied it to the forms used for creating the sales order.

<?xml version=”1.0″?><!DOCTYPE pdf PUBLIC “-//big.faceless.org//report” “report-1.1.dtd”>

<pdf>

<head>

<link name=”NotoSans type=”font subtype=”truetype src=”${nsfont.NotoSans_Regular} src-bold=”${nsfont.NotoSans_Bold} src-italic=”${nsfont.NotoSans_Italic} src-bolditalic=”${nsfont.NotoSans_BoldItalic} bytes=”2 />

<#if .locale == “zh_CN”>

<link name=”NotoSansCJKsc type=”font subtype=”opentype src=”${nsfont.NotoSansCJKsc_Regular} src-bold=”${nsfont.NotoSansCJKsc_Bold} bytes=”2 />

<#elseif .locale == “zh_TW”>

<link name=”NotoSansCJKtc type=”font subtype=”opentype src=”${nsfont.NotoSansCJKtc_Regular} src-bold=”${nsfont.NotoSansCJKtc_Bold} bytes=”2 />

<#elseif .locale == “ja_JP”>

<link name=”NotoSansCJKjp type=”font subtype=”opentype src=”${nsfont.NotoSansCJKjp_Regular} src-bold=”${nsfont.NotoSansCJKjp_Bold} bytes=”2 />

<#elseif .locale == “ko_KR”>

<link name=”NotoSansCJKkr type=”font subtype=”opentype src=”${nsfont.NotoSansCJKkr_Regular} src-bold=”${nsfont.NotoSansCJKkr_Bold} bytes=”2 />

<#elseif .locale == “th_TH”>

<link name=”NotoSansThai type=”font subtype=”opentype src=”${nsfont.NotoSansThai_Regular} src-bold=”${nsfont.NotoSansThai_Bold} bytes=”2 />

</#if>

<macrolist>

<macro id=”nlheader“>

<table style=”width: 100%; font-size: 10pt;“><tr>

<td rowspan=”2 style=”padding-top: -29px;padding-right:-5px;margin-left:8px;“><#if subsidiary.logo?length != 0><img src=”${subsidiary.logo@url} style=”float: left; margin: 6px; width:216px; height:90px /> </#if></td>

<td align=”right style=”padding: 0;“><span style=”font-weight: bold; font-size: 22pt;“>${record@title}</span><br />&nbsp;</td>

</tr>

<tr>

<td align=”right style=”padding: 0;“>

<table border=”1“><tr line-height=”170%“>

<td align=”center border-bottom=”1 px solid black border-right=”1 px solid black“>Date</td>

<td align=”center border-bottom=”1 px solid black“>S.O.No.</td>

</tr>

<tr line-height=”170%“>

<td align=”center border-right=”1 px solid black“>&nbsp;&nbsp;${record.trandate}&nbsp;&nbsp;</td>

<td align=”center“>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${record.tranid}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

</tr></table>

</td>

</tr>

<tr>

<td style=”padding-right:-5px;margin-left:21px;padding-top:-32px;line-height:17px;“>East Electronics<br />48273 Lakeview Blvd<br style=”margin-bottom: 20px; />Fremont, CA 94538</td>

</tr>

<tr>

<td>&nbsp;</td>

</tr></table>

</macro>

<macro id=”nlfooter“>

<table style=”width: 100%; font-size: 8pt;“><tr>

<td colspan=”13 align=”right style=”padding-right:-24px;“><pagenumber/> of <totalpages/></td></tr></table>

</macro>

</macrolist>

<style type=”text/css“>* {

<#if .locale == “zh_CN”>

font-family: NotoSans, NotoSansCJKsc, sans-serif;

<#elseif .locale == “zh_TW”>

font-family: NotoSans, NotoSansCJKtc, sans-serif;

<#elseif .locale == “ja_JP”>

font-family: NotoSans, NotoSansCJKjp, sans-serif;

<#elseif .locale == “ko_KR”>

font-family: NotoSans, NotoSansCJKkr, sans-serif;

<#elseif .locale == “th_TH”>

font-family: NotoSans, NotoSansThai, sans-serif;

<#else>

font-family: NotoSans, sans-serif;

</#if>

}

table {

font-size: 9pt;

table-layout: fixed;

}

th {

font-weight: bold;

font-size: 8pt;

vertical-align: middle;

padding: 5px 6px 3px;

background-color: #e3e3e3;

color: #333333;

}

td {

padding: 4px 6px;

}

td p { align:left }

</style>

</head>

<body header=”nlheader header-height=”13% footer=”nlfooter footer-height=”20pt padding=”0.5in 0.5in 0.5in 0.5in size=”Letter“>

<table style=”margin-top:10px;width:100%;padding-right:-5px;margin-left:22px;“><tr>

<td><!– Billing Address Table –>

<table align=”left style=”width: 100%;border:1 px solid black“><tr>

<td colspan=”12 style=”font-size: 8pt; padding: 6px 0px 2px 8px; color: rgb(51, 51, 51); border-bottom: 1px solid black; height: 25px;font-weight: bold;“>Name / Address</td>

</tr>

<tr height=”10%“>

<td colspan=”12 style=”padding: 0;padding-left:5px;padding-top:3px;“>${record.entity}<br/><br/>${record.billaddress}</td>

</tr></table>

</td>

<td><!– Shipping Address Table –>

<table align=”right style=”border:1px solid black;width:100%;“><tr>

<td colspan=”12 style=”font-size: 8pt; padding: 6px 0px 2px 8px; color: rgb(51, 51, 51); border-bottom: 1px solid black; height: 25px;font-weight: bold;“>${record.shipaddress@label}</td>

</tr>

<tr height=”10%“>

<td colspan=”12 style=”padding: 0;padding-left:5px;padding-top:3px;“>${record.shipaddress}</td>

</tr></table>

</td>

</tr></table>

<table align=”right style=”align:right;margin-top:10px;width:100%;“><tr>

<td colspan=”8“>&nbsp;</td>

<td colspan=”9“>&nbsp;</td>

<td align=”center colspan=”6 style=”border:1px solid black;“>P.O.No.</td>

<td align=”center colspan=”6 style=”border-top:1px solid black;border-right:1px solid black;border-bottom:1px solid black;“>Order Due Date</td>

<td align=”center colspan=”6 style=”border-top:1px solid black;border-right:1px solid black;border-bottom:1px solid black;“>Ship Via</td>

</tr>

<tr>

<td colspan=”8“>&nbsp;</td>

<td colspan=”9“>&nbsp;</td>

<td align=”center colspan=”6 style=”padding-top: 2px;border-left:1px solid black;border-right:1px solid black;vertical-align:middle“>${record.otherrefnum}</td>

<td align=”center colspan=”6 style=”padding-top: 2px;border-right:1px solid black;vertical-align:middle“>${record.enddate}</td>

<td align=”center colspan=”6 style=”padding-top: 2px;border-right:1px solid black;vertical-align:middle“>${record.shipmethod}</td>

</tr></table>

<#if record.item?has_content>

<table style=”width: 100%;“><!– start items –><#list record.item as item><#if item_index==0>

<thead>

<tr>

<th align=”center colspan=”8 style=”padding: 10px 6px;border-right:1px solid black;border-bottom:1px solid black;border-left:1px solid black;border-top:1px solid black;font-weight: bold;“>${item.item@label}</th>

<th align=”center colspan=”12 style=”padding: 10px 6px;border-right:1px solid black;border-bottom:1px solid black;border-top:1px solid black;font-weight: bold;“>Description</th>

<th align=”center colspan=”4 style=”padding: 10px 6px;border-right:1px solid black;border-bottom:1px solid black;border-top:1px solid black;font-weight: bold;“>Ordered</th>

<th align=”center colspan=”4 style=”padding: 10px 6px;border-right:1px solid black;border-bottom:1px solid black;border-top:1px solid black;font-weight: bold;“>${item.rate@label}</th>

<th align=”center colspan=”4 style=”padding: 10px 6px;border-bottom:1px solid black;border-top:1px solid black;border-right:1px solid black;font-weight: bold;“>${item.amount@label}</th>

</tr>

</thead>

</#if><tr>

<td colspan=”8 style=”border-right:1px solid black;border-bottom:1px solid black;border-left:1px solid black;vertical-align:middle“><span style=” line-height: 150%; color: #333333;“>${item.item}</span></td>

<td colspan=”12 style=”border-right:1px solid black;border-bottom:1px solid black;vertical-align:middle“>${item.description}</td>

<td colspan=”4 style=”border-right:1px solid black;border-bottom:1px solid black;align: center;vertical-align:middle“>${item.quantity}</td>

<td colspan=”4 style=”border-right:1px solid black;border-bottom:1px solid black;align: right;vertical-align:middle“>${item.rate}</td>

<td colspan=”4 style=”border-right:1px solid black;border-bottom:1px solid black;align: right;vertical-align:middle“>${item.amount}</td>

</tr>

</#list><!– end items –>

<tr line-height=”150%“>

<td colspan=”24 style=”font-weight: bold; font-size: 14px; border-bottom: 1px solid black;border-left:1px solid black; text-align: left; vertical-align: middle;“>${record.total@label}</td>

<td align=”right colspan=”8 style=”border-right:1px solid black;border-bottom:1px solid black;font-size: 10px;text-align: left; vertical-align: middle;“>USD ${record.total?replace(‘$’, ”)}</td>

</tr>

</table>

</#if>

</body>

</pdf>

Leave a comment

Your email address will not be published. Required fields are marked *