Jira Code: OTG-3
To add the tax rate in the TOTAL BOX of the Estimate PDF template. For
getting the tax rate, fetch the tax rate from the first line of the item line and add it to a separate variable, then show this variable to the specified place in the Tax field.
<?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 class="header" style="width: 100%;"><tr>
<td colspan="2"><img src="https://system.na2.netsuite.com/core/media/media.nl?id=13407461&c=3425005&h=1d1d518d63516a02db86&whence=" width="100%" /></td>
<td align="right" colspan="3"><span class="title" style="font-size:25px;"><b>OFFERTE</b></span><span class="number" style="font-size:25px;"> ${record.tranid}</span></td>
</tr>
<tr><!-- <td rowspan="3"><span class="nameandaddress">${companyInformation.addressText}</span></td> -->
<td>Oud Camp 22</td>
<td>T: +31 (0) 88 697 2537</td>
<td align="right" colspan="3" style="font-size:15px;"><b>Datum:</b> ${record.trandate?string['dd/MM/yyyy']}</td>
</tr>
<tr>
<td>3155 DL Maasland</td>
<td>F: +31 (0) 88 697 2599</td>
</tr>
<tr>
<td>sales.nl@oxtools.com</td>
<td>W: www.oxtools.com</td>
</tr></table>
</macro>
<macro id="nlfooter">
<table class="footer" style="width: 100%;"><tr>
<td>
<p align="center" style="font-size:10px;">Op alle verkopen en leveringen van onze producten zijn onze algemene verkoop- en leveringsvoorwaarden van toepassing, die zijn gedeponeerd bij de Kamer van Koophandel nr. 53313461</p>
</td>
</tr></table>
</macro>
</macrolist>
<style type="text/css">table {
<#if .locale == "zh_CN">
font-family: stsong, sans-serif;
<#elseif .locale == "zh_TW">
font-family: msung, sans-serif;
<#elseif .locale == "ja_JP">
font-family: heiseimin, sans-serif;
<#elseif .locale == "ko_KR">
font-family: hygothic, sans-serif;
<#elseif .locale == "ru_RU">
font-family: verdana;
<#else>
font-family: sans-serif;
</#if>
font-size: 9pt;
table-layout: fixed;
}
th {
font-weight: bold;
font-size: 8pt;
vertical-align: left;
padding: 5px 6px 3px;
text-align: left;
border: solid;
}
td {
padding: 4px 6px;
}
b {
font-weight: bold;
}
table.header td {
padding: 0px;
font-size: 10pt;
}
table.footer td {
padding: 0px;
font-size: 8pt;
}
table.itemtable th {
padding-bottom: 10px;
padding-top: 10px;
border: solid;
border-collapse: collapse;
}
table.body td {
padding-top: 2px;
}
table.total {
page-break-inside: avoid;
}
tr.totalrow {
line-height: 200%;
}
td.totalboxtop {
font-size: 12pt;
background-color: #e3e3e3;
}
th.itemlist {
background-color: #55c5f0;
font-weight: bold;
color: #000000;
border-top: none;
border-bottom: medium;
border: solid;
}
td.addressheader {
font-size: 8pt;
padding-top: 6px;
padding-bottom: 2px;
background-color: #55c5f0;
font-weight: bold;
color: #000000;
border: solid;
border-collapse: collapse;
}
td.address {
padding-top: 2px;
border-top: none;
border: solid;
border-collapse: collapse;
}
td.totalboxmid {
font-size: 28pt;
padding-top: 20px;
background-color: #e3e3e3;
border: solid;
border-collapse: collapse;
}
td.totalboxbot {
background-color: #e3e3e3;
font-weight: bold;
}
td.bodyinfo {
text-align: left;
border-top: none;
border: solid;
}
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;
}
</style>
</head>
<body header="nlheader" header-height="10%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
<table style="width: 100%; margin-top: 10px;"><tr>
<td colspan="3"> </td>
</tr>
<tr>
<td class="addressheader" colspan="3"><b>Factuuradres</b></td>
<td> </td>
<td class="addressheader" colspan="3"><b>Afleveradres</b></td>
</tr>
<tr>
<td class="address" colspan="3" rowspan="2">${record.billaddress}</td>
<td> </td>
<td class="address" colspan="3" rowspan="2">${record.shipaddress}</td>
</tr>
<tr></tr></table>
<table style="width: 100%; margin-top: 10px;"><tr>
<th>Onze referentie:</th>
<th>Betalingscondities:</th>
<th>Telefoon:</th>
<th>Offerte geldig tot:</th>
</tr>
<tr>
<td class="bodyinfo" style="padding-top: 2px;">${record.salesrep}</td>
<td class="bodyinfo" style="padding-top: 2px;">${record.terms}</td>
<td class="bodyinfo" style="padding-top: 2px;">${record.custbody_phone}</td>
<td class="bodyinfo" style="padding-top: 2px;">${record.duedate}</td>
</tr></table>
<#assign taxrate = 0>
<#list record.item as item>
<#if item_index==0>
<#assign taxrate = item.taxrate1>
</#if>
</#list>
<#if record.item?has_content>
<table border="1" class="itemtable" height="90%" style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item><#if item_index==0>
<thead>
<tr>
<th align="left" class="itemlist" colspan="5" style="padding: 10px 6px;">Artikelcode</th>
<th class="itemlist" colspan="12" style="padding: 10px 6px;">Artikelomschrijving</th>
<th align="right" class="itemlist" colspan="4" style="padding: 10px 6px;">Aantal</th>
<th align="right" class="itemlist" colspan="5" style="padding: 10px 6px;">Prijs per eenheid</th>
<th align="right" class="itemlist" colspan="5" style="padding: 10px 6px;">Totaal</th>
</tr>
</thead>
</#if><tr>
<td align="left" colspan="5" line-height="150%">${item.custcol11}</td>
<td colspan="12">${item.description}</td>
<td align="right" colspan="4">${item.quantity}</td>
<td align="right" colspan="5">${item.rate}</td>
<td align="right" colspan="5">${item.amount}</td>
</tr>
</#list><!-- end items --></table>
<hr style="width: 100%; color: #d3d3d3; background-color: #d3d3d3; height: 1px;" /></#if>
<table width="100%"><tr>
<td align="right" width="70%"><b>Subtotaal excl. BTW</b></td>
<td align="right">${record.subtotal}</td>
</tr>
<tr>
<td align="right"><b>Verzendkosten</b></td>
<td align="right"><#if record.shippingcost?length == 0>€0,00</#if><#if record.shippingcost!?length != 0>${record.shippingcost}</#if></td>
</tr>
<tr>
<td align="right"><b>BTW bedrag (${taxrate})</b></td>
<td align="right"><#if record.taxtotal?length == 0>€0,00</#if><#if record.taxtotal!?length != 0>${record.taxtotal}</#if></td>
</tr>
<tr class="totalrow">
<td align="right"><b>Total bedrag incl. BTW</b></td>
<td align="right">${record.total}</td>
</tr></table>
</body>
</pdf>