The client would like to create a purchase order pdf on clicking the Print from the Purchase order record.
We have customized the advanced pdf template and applied the same to the form used for creating the purchase 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: -25px;padding-right:-5px;margin-left:8px;“><#if subsidiary.logo?length != 0><img src=”${subsidiary.logo@url}“ style=”float: left; margin: 6px; width:216px; height:120px“ /> </#if></td>
<td align=”right“ style=”padding: 0;margin-top:-4px;“><span style=”font-weight: bold; font-size: 20pt;“>${record@title}</span></td>
</tr>
<tr>
<td align=”right“ style=”padding: 0;“>
<table border=”1“><tr line-height=”200%“>
<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“>P.O.No.</td>
</tr>
<tr line-height=”200%“>
<td align=”center“ border-right=”1 px solid black“> ${record.trandate} </td>
<td align=”center“> ${record.tranid} </td>
</tr></table>
</td>
</tr>
<tr></tr></table>
</macro>
<macro id=”nlfooter“>
<table style=”width: 100%; padding-top:0px;“><tr>
<td colspan=”13“>
<p style=”font-size:12px;“>If there are any discrepancies such as pricing, part number, product description, etc., it is mandatory that we be informed immediately. We will then submit a revised Purchase Order upon approval of any such change(s).</p>
</td>
</tr>
<tr><td colspan=”13“ align=”right“ style=”padding-right:-26px;“><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=”11.5%“ footer=”nlfooter“ footer-height=”28pt“ padding=”0.5in 0.5in 0.5in 0.5in“ size=”Letter“>
<table style=”margin-top:5px;width:100%;padding-right:-5px;margin-left:22px;padding-top:15px;“><tr>
<td><!– Billing Address Table –>
<table align=”left“ style=”width: 100%;border:1 px solid black“><tr>
<td colspan=”12“ style=”font-size: 9pt; padding: 6px 0px 2px 8px; font-weight: bold; color: rgb(51, 51, 51); border-bottom: 1px solid black; height: 25px;“>Vendor</td>
</tr>
<tr height=”10%“>
<td colspan=”12“ style=”padding: 0;padding-left:5px;padding-top:3px;height:50%“>${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: 9pt; padding: 6px 0px 2px 8px; font-weight: bold; color: rgb(51, 51, 51); border-bottom: 1px solid black; height: 25px;“>${record.shipaddress@label}</td>
</tr>
<tr height=”10%“>
<td colspan=”12“ style=”padding: 0;padding-left:5px;padding-top:3px;height:50%“>${record.shipaddress}</td>
</tr></table>
</td>
</tr></table>
<#if record.item?has_content>
<table align=”right“ style=”align:right;margin-top:18px;width:100%;“><tr>
<td colspan=”10“> </td>
<td align=”center“ colspan=”7“ style=”border-left:1px solid black;border-top:1px solid black;border-bottom:1px solid black;“>Customer Name</td>
<td align=”center“ colspan=”6“ style=”border:1px solid black;“>Customer PO #</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=”10“> </td>
<td align=”center“ colspan=”7“ style=”padding-top: 2px;border-left:1px solid black;vertical-align:middle“>${record.createdfrom.entity}</td>
<td align=”center“ colspan=”6“ style=”padding-top: 2px;border-left:1px solid black;border-right:1px solid black;vertical-align:middle“>${record.createdfrom.otherrefnum}</td>
<td align=”center“ colspan=”6“ style=”padding-top: 2px;border-right:1px solid black;vertical-align:middle“>${record.duedate}</td>
<td colspan=”6“ style=”padding-top: 2px;border-right:1px solid black;vertical-align:middle“>${record.shipmethod}</td>
</tr></table>
<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;font-size: 9pt;“>${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;font-size: 9pt;“>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;font-size: 9pt;“>Qty</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;font-size: 9pt;“>${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;font-size: 9pt;“>${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>
<td colspan=”24“ style=”font-weight: bold; font-size: 14px;text-align: left; vertical-align: middle;border-bottom:1px solid black;border-left:1px solid black;“>${record.total@label}</td>
<td colspan=”8“ style=”align: right; vertical-align: middle;border-right:1px solid black;border-bottom:1px solid black“>USD ${record.total?replace(‘$’, ”)}</td>
</tr></table>
</#if>
</body>
</pdf>