The client(Rabbit Hole Hay-US-NS) would like to create a custom pdf for the certificate of origin. The mapping and mock-up is already given by the client. We have created a button on the invoice record to print the template.
RHHUN-16
<?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%;"><tr>
<td align="right" style="padding-bottom: 4px; padding-right: 0px; padding-top: -9px;"><span style="font-size: 40px; color: #568b4e; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; ">Certificate Of Origin</span></td>
</tr>
<tr>
<td align="right" style="padding-bottom: 4px; padding-right: 0px;"><span style="font-size: 18pt; color: #568b4e; font-weight: bold; font-family: apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;">#${record.tranid}</span></td>
</tr>
<tr>
<td align="right" style="padding-bottom: -28px; padding-right: 0px;"><span style="font-size: 16pt; color: #568b4e; font-family: apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;">${record.trandate}</span></td>
</tr>
<tr>
<td align="right"> </td>
</tr>
<tr>
<td align="right"> </td>
</tr>
<tr>
<td> </td>
</tr></table>
<table style="width: 100%; font-size: 12pt;">
<tr>
<td colspan="10"> </td>
<td align="left" colspan="5">
<span style="font-size: 12pt; color: #568b4e; font-weight: bold; font-family: apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;">CONSIGNER</span>
</td>
</tr>
<tr><td></td></tr>
<tr>
<td colspan="11"> </td>
<td colspan="4" style="padding-right: 0px;color: #568b4e;font-size: 13px;padding-top:-1px;">Rabbit Hole Hay, Inc.</td>
</tr>
<tr>
<td colspan="11"> </td>
<td colspan="4" style="padding-right: 0px; color: #568b4e;font-size: 13px;padding-top:-4px;">199 E. 13th St.</td>
</tr>
<tr>
<td colspan="11"> </td>
<td colspan="4" style="padding-right: 0px; color: #568b4e;font-size: 13px;padding-top:-9px;">Chico, CA 95928</td>
</tr>
<tr>
<td colspan="11"> </td>
<td colspan="4" style="padding-right: 0px;color: #568b4e;font-size: 13px;padding-top:-12px;">United States of America</td>
</tr>
</table>
</macro>
<macro id="nlfooter">
<table class="footer" style="width: 100%;"><tr>
<td align="right" class="address" colspan="6" style="color: #FFFFFF; text-align: right;padding-top:138pt;">(530) 763-6900</td>
</tr>
<tr>
<td align="right" class="address" colspan="7" style="color: #FFFFFF; text-align: right;">accounting@rabbitholehay.com</td>
<td align="right" class="address" colspan="4"> <pagenumber/> of <totalpages/></td>
</tr></table>
</macro>
<macro id="watermark">
<p><img src="https://4501420.app.netsuite.com/core/media/media.nl?id=5067&c=4501420&h=qjqhcGn5NY3ZBOF5_8Fk0GwXp5J8Mw4st2h6YdFN5f4R8eWe" style="width: 612; height: 792;" /></p>
</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;
}
td p { align:left }
b {
font-weight: bold;
color: #333333;
}
table.header td {
padding: 0px;
font-size: 10pt;
}
table.footer td {
padding: 0px;
font-size: 12pt;
}
table.itemtable th {
padding-bottom: 10px;
padding-top: 10px;
}
table.total {
page-break-inside: avoid;
}
tr.totalrow {
background-color: #e3e3e3;
line-height: 200%;
}
td.totalboxtop {
font-size: 12pt;
background-color: #e3e3e3;
}
td.addressheader {
font-size: 8pt;
padding-top: 6px;
padding-bottom: 2px;
}
span.title {
font-size: 28pt;
}
span.number {
font-size: 16pt;
}
span.itemname {
font-weight: bold;
line-height: 150%;
}
hr {
width: 100%;
color: #d3d3d3;
background-color: #d3d3d3;
height: 1px;
}
.address {
text-align: center;
padding-left: 0px;
}
table.alignitem td p{
align:left
}
.green-barcode {
color: #578E4E
height:120px
}
</style>
</head>
<body header="nlheader" header-height="24%" footer="nlfooter" footer-height="20%" background-macro="watermark" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
<table style="width: 100%;"><tr>
<td align="left" colspan="3" style="font-size: 14px; padding: 6px 6px 6px 6px; font-weight: bold; color: #568b4e;">CONSIGNEE</td>
</tr>
<tr>
<td align="left" colspan="3" style="padding:0px 0px 0px 6px; line-height: 12pt; color: #568b4e; font-size: 13px; "><#if record.billingaddress.attention?has_content><#assign attetion = record.billingaddress.attention><#if record.billingaddress.addressee?has_content><#assign addressee = record.billingaddress.addressee><#if attetion != addressee>${record.billingaddress.attention}<br /></#if> </#if> </#if> <#if record.billingaddress.addressee?has_content>${record.billingaddress.addressee}<br /></#if> <#if record.billingaddress.addr1?has_content>${record.billingaddress.addr1}<br /></#if> <#if record.billingaddress.addr2?has_content>${record.billingaddress.addr2}<br /></#if> <#if record.billingaddress.city?has_content>${record.billingaddress.city}</#if> <#if record.billingaddress.state?has_content>${record.billingaddress.state}</#if> <#if record.billingaddress.zip?has_content>${record.billingaddress.zip}<br /></#if> <#if record.billingaddress.country?has_content>${record.billingaddress.country}<br /></#if></td>
</tr>
<tr>
<td align="left"> </td>
</tr></table>
<#if record.item?has_content>
<table class="alignitem" style="width: 100%; margin-top: 10px; background-color: #f5f4e4;margin-left: -9px;padding-left: 0px;">
<thead>
<tr>
<th align="left" colspan="12" style="padding: 10px 0px; text-transform: uppercase; font-size: 12px;color: #4F5734;padding-left:20px">ITEM</th>
<th align="right" colspan="4" style="padding: 10px 0px; text-transform: uppercase; font-size: 12px;color: #4F5734;">NET</th>
<th align="right" colspan="4" style="padding-top: 10px; padding-bottom: 10px; padding-left:0px; padding-right:12px; text-transform: uppercase; font-size: 12px;color: #4F5734;">GROSS</th>
<th align="center" colspan="4" style="padding: 10px 0px; text-transform: uppercase; font-size: 12px; color: #4F5734;">QTY SHIPPED</th>
</tr>
</thead>
<#assign totalWeight=0>
<#assign totalNetWeight=0><#assign totalQnty=0><#assign netWeigt=0>
<#list record.item as item>
<tr>
<td colspan="12" style="color: #4F5734;padding-left:20px"><span class="itemname">${item.item}</span><br />${item.description}</td>
<td align="right" colspan="4" style="color: #4F5734;"> <#if item.custcol_jj_inv_netweight?has_content>
${item.custcol_jj_inv_netweight} LBS
<#else>
0 LBS
</#if></td>
<td align="right" colspan="4" style="color: #4F5734;"> <#if item.custcol_ltweight?has_content>${item.custcol_ltweight} LBS <#else>
0 LBS
</#if></td>
<td align="right" colspan="4" style="color: rgb(79, 87, 52); text-align: center;padding-right:16pt;">${item.quantity}</td>
</tr>
<#assign totalQnty = totalQnty + item.quantity>
<#assign totalWeight = totalWeight + item.custcol_ltweight>
<#assign totalNetWeight = totalNetWeight + item.custcol_jj_inv_netweight>
</#list></#if>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="right" colspan="12" style="color: #4F5734;font-size: 14px;font-weight: bold;">TOTALS</td>
<td align="right" colspan="4" style="color: #4F5734;font-size: 14px;font-weight: bold;">${totalNetWeight} lbs</td>
<td align="right" colspan="4" style="color: #4F5734;font-size: 14px;font-weight: bold;">${totalWeight} LBS</td>
<td align="right" colspan="4" style="color: #4F5734;font-size: 14px;font-weight: bold;margin-right: 18px;">${totalQnty}</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr></table>
<table style="background-color:#f5f4e4;border-collapse:collapse;height:200px;width:100%;margin-top:10px"><tr>
<td rowspan="10" style="padding: 10px;font-size: 12px;color: #777C62;">Notarize</td>
</tr></table>
</body>
</pdf>