Integrated item invoice template

Jira Code: ME-189

Created a customized advanced PDF template for the integrated and normal items in a sales order. They need to change the invoice title according to the customer type if the customer is overseas and the items are not service items it should show Tax Invoice otherwise it should go with Export Invoice.

Advanced PDF Template for Normal Invoice

<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdfset>
<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"><#assign count =0>
          <#list record.item as item><#if item.itemtype == 'Service'> <#assign count =1> </#if></#list>
           <table width="100%"><tr><td align="left" style="padding-top:-10px;"> 
                                 <img src="https://system.netsuite.com/core/media/media.nl?id=4406&c=5318034_SB1&h=d6cfe6693b342d031655" style="padding-left:-5px;width:220px;height:80px" />
             <p style="padding-top:-10px;" ><b>${companyInformation.companyName}</b></p>
             <p align="left" font-size="9" style="padding-top:-10px;">1826/II/23 New Amarnath Building</p>
<p align="left" font-size="9" style="padding-top:-10px;">Bhagirath Palace</p>
<p align="left" font-size="9" style="padding-top:-10px;">Chandni Chowk Delhi 110006</p>
<p align="left" font-size="9" style="padding-top:-10px;">India</p>
             <p align="left" font-size="9" style="padding-top:-10px;"><b>GSTIN:</b> 07AAJPK0556E1ZX</p>
             <p align="left" font-size="9" style="padding-top:-10px;"><b>State Code:</b> 07</p>
               <p align="left" font-size="9" style="padding-top:-10px;"><b>Email:</b> sales@manglamelectricals.com</p>
             </td><td align="right"><p style="padding-top:-2px;">(ORIGINAL FOR RECIPIENT)</p><#if record.entity.custentity_in_gst_vendor_regist_type =='SEZ' || record.entity.custentity_in_gst_vendor_regist_type =='Overseas' && count =0><span class="title">Export Invoice</span><#else><span class="title">Tax Invoice</span></#if>
             <p font-size="10" ><b>Invoice No:</b> ${record.tranid}</p> <p  font-size="10"><b>Date:</b> ${record.trandate}</p></td></tr> </table>
          
          
 
        </macro>
        <macro id="nlfooter">
          
            <table class="footer" style="width: 100%;"><tr>
              <td><barcode codetype="code128" showtext="true" value="${record.tranid}"/></td>
    <td align="right"><pagenumber/> of <totalpages/></td>
    </tr></table>
       <p font-size="9" align="center" >This is a Computer Generated Invoice</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;
            background-color: #e3e3e3;
            color: #333333;
        }
        td {
            padding: 4px 6px;
        }
        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: 8pt;
        }
        table.itemtable th {
            padding-bottom: 10px;
            padding-top: 10px;
        }
        table.body td {
            padding-top: 2px;
        }
        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;
        }
        td.address {
            padding-top: 0px;
        }
        td.totalboxmid {
            font-size: 28pt;
            padding-top: 20px;
            background-color: #e3e3e3;
        }
        td.totalboxbot {
            background-color: #e3e3e3;
            font-weight: bold;
        }
        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;
        }
        .invoicebox
      {
        border:1px; border-color:#000000; margin-top:2px;width:211px;padding-bottom:0px;padding-top:1px;min-height:100px;max-height:100px;
      }
</style>
</head>
<body header="nlheader" header-height="20%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
   <#assign currency={"US Dollar":"$", "Euro" :"€", "British pound" :"£", "Indian Rupee" :"₹"}>
          <table align="left" width="100%"  style="padding-left:-5px;margin-top:15px;"><tr><td><table>
          <tr><td><b>Delivery Note No. </b></td><td>:</td><td>${record.custbody1}</td></tr>
          <tr><td><b>Delivery Note Date </b></td><td>:</td><td>${record.custbody2}</td></tr>
          <tr><td><b>Due Date </b></td><td>:</td><td>${record.duedate}</td></tr>
          <tr><td><b>Your Order Ref </b></td><td>:</td><td>${record.otherrefnum}</td></tr>
          <tr><td><b>PO Date </b></td><td>:</td><td>${record.custbody3}</td></tr>
          </table></td>
      <td><table>
           <tr><td><b>Mode/Terms of Payment </b></td><td>:</td><td>${record.terms}</td></tr>
            <tr><td><b>Dispatch Document No. </b></td><td>:</td><td>${record.custbody6}</td></tr>
           <tr><td><b>Dispatched Through </b></td><td>:</td><td>${record.custbody_jj_dispatch_through}</td></tr>
           <tr><td><b>Destination </b></td><td>:</td><td>${record.shipcity}</td></tr>
          <tr><td><b>Term of Delivery </b></td><td>:</td><td>${record.custbody7}</td></tr> </table></td></tr></table>
    <table style="width: 100%; margin-top: 20px;">
                <tr>
                    <td class="addressheader" colspan="4"><b>${record.billaddress@label}</b></td>
                    <td class="addressheader" colspan="3"><b>${record.shipaddress@label}</b></td>
                    <td class="totalboxtop" colspan="6"><b>${record.total@label?upper_case}</b></td>
                </tr>
                <tr>
                     <td class="address" colspan="4" rowspan="2">${record.billaddress}
      </td>
                    <td class="address" colspan="3" rowspan="2">${record.shipaddress}</td>
                    <td align="right" class="totalboxmid" colspan="6"> ${record.total}</td>
                </tr>
                <tr>
                </tr>
            </table>
<p align="left" style="  font-size: 8pt;">
      <b>Email:</b> ${record.entity.email}
      </p>
      <p align="left" style="  font-size: 8pt;">
        <b>Phone:</b> ${record.entity.phone}
      </p>
<table class="body" style="width: 100%; margin-top: 10px;"><tr>
    
    <th>Place of Supply</th>
    <th>${record.salesrep@label}</th>
  <th><p align="right">${record.shipmethod@label}</p></th>
    
    </tr>
    <tr>
      <td>${record.custbody_in_place_of_supply}</td>
    <td>${record.salesrep}</td>
      <td><p align="right">${record.custbody_jj_shipping_method}</p></td>
    
    </tr></table>
   <#assign count = 0>
  <#list record.item as item>
	<#if item.itemtype?contains("Group") >
       <#assign count = 1>
      </#if>
    </#list> 
    
    
 
<#if record.item?has_content && count = 0>

<#assign index = 0>
<table font-size="7" class="itemtable" style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item><#if item_index==0>
<thead>
	<tr>
	<th colspan="4">SNo.</th>
      <th colspan="16"><p align="left">Item Code Description</p></th>
      <th colspan="8"><p align="left">HSN/SAC</p></th>
       <th colspan="6"><p align="left">UOM</p></th>
    <th align="center" colspan="5">Qty</th>
	<th align="right" colspan="12">${item.rate@label}</th>
	<th align="right" colspan="12">${item.amount@label}</th>
	<th align="right" colspan="8" style="padding: 10px 6px; white-space: nowrap;">${item.taxrate@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.taxamount@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.grossamt@label}</th>
	</tr>
</thead>
  </#if><#if item.itemtype != 'OthCharge'><#if item.custcol_jj_substitute_item?contains("Yes")><tr><td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.custcol_jj_me102_substitute_item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.custcol_jj_me102_substitute_item_des}</td>
	<td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr> <#else><tr>
  <td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.description}</td>
  <td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr></#if></#if>
  </#list><!-- end items --></table><hr style="width: 100%; color: #d3d3d3; background-color: #d3d3d3; height: 1px;" /></#if>
  <#if record.item?has_content && count = 1>

<#assign index = 0>
<table font-size="7" class="itemtable" style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item><#if item_index==0>
<thead>
	<tr>
	<th colspan="4">SNo.</th>
      <th colspan="16"><p align="left">Item Code Description</p></th>
      <th colspan="8"><p align="left">HSN/SAC</p></th>
       <th colspan="6"><p align="left">UOM</p></th>
    <th align="center" colspan="5">Qty</th>
	<th align="right" colspan="12">${item.rate@label}</th>
	<th align="right" colspan="12">${item.amount@label}</th>
	<th align="right" colspan="8" style="padding: 10px 6px; white-space: nowrap;">${item.taxrate@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.taxamount@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.grossamt@label}</th>
	</tr>
</thead>
  </#if><#if item.itemtype != 'OthCharge'><#if item.itemtype !='Group' && item.itemtype !='EndGroup'  && item.custcol_jj_me71_show_item?string=="Yes" ><#if item.custcol_jj_substitute_item?contains("Yes")><tr><td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.custcol_jj_me102_substitute_item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.custcol_jj_me102_substitute_item_des}</td>
	<td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr> <#else><tr>
  <td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.description}</td>
  <td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr></#if></#if></#if>
  </#list><!-- end items --></table></#if>
<!-- start Tax Summary --><#if record.item?has_content>
<table style="width: 100%; margin-top: 10px;"><#list record.taxsummary as tax><#if tax_index==0><tr>
    <th >${tax.taxtype@label}</th>
    <th colspan="2" >${tax.taxcode@label}</th>
    <th >${tax.taxbasis@label}</th>
    <th>${tax.taxrate@label}</th>
    <th>${tax.taxamount@label}</th>
    </tr>
    </#if>
    <tr>
    <td>${tax.taxtype}</td>
    <td colspan="2">${tax.taxcode}</td>
    <td>${tax.taxbasis}</td>
    <td>${tax.taxrate}</td>
    <td>${tax.taxamount}</td>
    </tr>
    </#list>
    </table>
 <!--<table align="right" style="padding-right:-15px;" ><tr align="right" style="background-color: #e3e3e3; line-height: 200%;">
    <td background-color="#ffffff" colspan="6"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.total@label}</td>
    <td align="left">${record.taxtotal}</td>
    <td background-color="#ffffff" colspan="3"> </td>
  </tr></table>-->
</#if><!-- end Tax Summary -->

  <#assign chargeAmt = 0>
  <#list record.item as item>
	<#if item.itemtype =='OthCharge' >
       <#assign chargeAmt = chargeAmt + item.amount>
      </#if>
    </#list>

  <table style="page-break-inside: avoid; width: 100%; margin-top: 10px;"><tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.subtotal@label}</td>
    <td align="right"><#if chargeAmt !=0 ><#assign subchargeAmt = record.subtotal - chargeAmt>${currency[record.currency]}${subchargeAmt?string["0.00"]}<#else>${record.subtotal}</#if></td>
    </tr>
   <#list record.item as item>
   <#if item.itemtype =='OthCharge' >
       <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${item.item}</td>
  <td align="right">${item.amount}</td>
    </tr>
      </#if>
    </#list>
  <#if record.taxtotal2?has_content >
   <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">IGST</td>
    <td align="right">${record.taxtotal2}</td>
    </tr></#if>
   <#if record.taxtotal5?has_content >
  <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">UTGST</td>
    <td align="right">${record.taxtotal5}</td>
     </tr></#if>
   <#if record.taxtotal3?has_content >
  <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">CGST</td>
    <td align="right">${record.taxtotal3}</td>
     </tr></#if>
  
    <!--<tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.taxtotal@label}</td>
    <td align="right">${record.taxtotal}</td>
    </tr>-->
    <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">Round Off</td>
      <td align="right"><#assign round = record.total?round ><#assign round = record.total - round >${currency[record.currency]} ${round?string["##0.00"]}</td>
    </tr>
    <tr style="background-color: #e3e3e3; line-height: 200%;">
    <td background-color="#ffffff" colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.total@label}</td>
    <td align="right">${record.total}</td>
    </tr></table>
<!--<table class="total" style="width: 100%; margin-top: 10px;"><tr>
    <td colspan="4"> </td>
    <td align="right"><b>${record.subtotal@label}</b></td>
    <td align="right">${record.subtotal}</td>
    </tr>
    <tr>
    <td colspan="4"> </td>
    <td align="right"><b>${record.taxtotal@label}</b></td>
    <td align="right">${record.taxtotal}</td>
    </tr>
    <tr class="totalrow">
    <td background-color="#ffffff" colspan="4"> </td>
    <td align="right"><b>${record.total@label}</b></td>
    <td align="right">${record.total}</td>
  </tr></table>-->
  <table width="100%"><tr><td align="left" colspan="2"><p font-size="8">Amount (in words): <b>${record.custbody_amount_in_wrds}</b></p><p font-size="8">Company's PAN: <b> AAJPK0556E</b></p><#if record.entity.custentity_in_gst_vendor_regist_type =='SEZ' || record.entity.custentity_in_gst_vendor_regist_type =='Overseas'><br/><br/><br/><br/><p>Declaration</p><p>1) Supply meant for SEZ unit/ SEZ Developers with the
payment of IGST</p>
<p>2) Supply meant for SEZ unit/SEZ Developers with filing of
LUT No.</p>
<p>3) Supply meant for Export with the payment of IGST</p>
<p>4) Supply meant for Export with filing of LUT No.</p>
<p>5) Supply meant for Export with filling of Bond </p><#else>
  <br/><br/><br/><br/><br/><br/><br/><p>Declaration</p><p>i. The above goods are sent in perfect order and condition.
</p>
  <p>ii. Goods once sold will not be accepted back.</p>
<p>iii. Interest@ 24% p.a. will be charged if not paid as per agreed payment terms.
</p><p>iv. The property in the goods will not be transferred unless 100% payment is made.</p></#if></td><td>
  <table><tr><td align="left"><p font-size="10">Company's Bank Details</p></td></tr>
    <tr><td><table style="padding-left:-6px;"><tr><td><p>Bank Name</p></td><td>:</td><td>${companyInformation.custrecord1}</td></tr><tr><td><p>A/C No.</p></td><td>:</td><td>${companyInformation.custrecord2}</td></tr><tr><td><p>Bank & IFSC Code</p></td><td>:</td><td>${companyInformation.custrecord3} </td></tr><tr><td><table  style="margin-top:10px;page-break-inside: avoid;" class="invoicebox"><tr><td><p align="left" >For Manglam Electricals</p></td></tr><tr><td><p align="right"></p></td></tr><tr><td><p align="right"></p></td></tr><tr><td><p align="right">Authorised Signatory </p></td></tr></table></td></tr></table></td></tr></table></td></tr></table>
  
</body>
</pdf>
<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"><#assign count = 0>
          <#list record.item as item><#if item.itemtype == 'Service'> <#assign count =1> </#if></#list>
           <table width="100%"><tr><td align="left" style="padding-top:-10px;"> 
                                 <img src="https://system.netsuite.com/core/media/media.nl?id=4406&c=5318034_SB1&h=d6cfe6693b342d031655" style="padding-left:-5px;width:220px;height:80px" />
             <p style="padding-top:-10px;" ><b>${companyInformation.companyName}</b></p>
             <p align="left" font-size="9" style="padding-top:-10px;">1826/II/23 New Amarnath Building</p>
<p align="left" font-size="9" style="padding-top:-10px;">Bhagirath Palace</p>
<p align="left" font-size="9" style="padding-top:-10px;">Chandni Chowk Delhi 110006</p>
<p align="left" font-size="9" style="padding-top:-10px;">India</p>
             <p align="left" font-size="9" style="padding-top:-10px;"><b>GSTIN:</b> 07AAJPK0556E1ZX</p>
             <p align="left" font-size="9" style="padding-top:-10px;"><b>State Code:</b> 07</p>
               <p align="left" font-size="9" style="padding-top:-10px;"><b>Email:</b> sales@manglamelectricals.com</p>
             </td><td align="right"><p style="padding-top:-2px;">(DUPLICATE FOR TRANSPORTER)</p><#if record.entity.custentity_in_gst_vendor_regist_type =='SEZ' || record.entity.custentity_in_gst_vendor_regist_type =='Overseas' && count =0 ><span class="title">Export Invoice</span><#else><span class="title">Tax Invoice</span></#if>
             <p font-size="10" ><b>Invoice No:</b> ${record.tranid}</p> <p  font-size="10"><b>Date:</b> ${record.trandate}</p></td></tr> </table>
          
          
 
        </macro>
        <macro id="nlfooter">
          
            <table class="footer" style="width: 100%;"><tr>
              <td><barcode codetype="code128" showtext="true" value="${record.tranid}"/></td>
    <td align="right"><pagenumber/> of <totalpages/></td>
    </tr></table>
       <p font-size="9" align="center" >This is a Computer Generated Invoice</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;
            background-color: #e3e3e3;
            color: #333333;
        }
        td {
            padding: 4px 6px;
        }
        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: 8pt;
        }
        table.itemtable th {
            padding-bottom: 10px;
            padding-top: 10px;
        }
        table.body td {
            padding-top: 2px;
        }
        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;
        }
        td.address {
            padding-top: 0px;
        }
        td.totalboxmid {
            font-size: 28pt;
            padding-top: 20px;
            background-color: #e3e3e3;
        }
        td.totalboxbot {
            background-color: #e3e3e3;
            font-weight: bold;
        }
        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;
        }
        .invoicebox
      {
        border:1px; border-color:#000000; margin-top:2px;width:211px;padding-bottom:0px;padding-top:1px;min-height:100px;max-height:100px;
      }
</style>
</head>
<body header="nlheader" header-height="20%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
  <#assign currency={"US Dollar":"$", "Euro" :"€", "British pound" :"£", "Indian Rupee" :"₹"}>
          <table align="left" width="100%"  style="padding-left:-5px;margin-top:15px;"><tr><td><table>
          <tr><td><b>Delivery Note No. </b></td><td>:</td><td>${record.custbody1}</td></tr>
          <tr><td><b>Delivery Note Date </b></td><td>:</td><td>${record.custbody2}</td></tr>
          <tr><td><b>Due Date </b></td><td>:</td><td>${record.duedate}</td></tr>
          <tr><td><b>Your Order Ref </b></td><td>:</td><td>${record.otherrefnum}</td></tr>
          <tr><td><b>PO Date </b></td><td>:</td><td>${record.custbody3}</td></tr>
          </table></td>
      <td><table>
           <tr><td><b>Mode/Terms of Payment </b></td><td>:</td><td>${record.terms}</td></tr>
            <tr><td><b>Dispatch Document No. </b></td><td>:</td><td>${record.custbody6}</td></tr>
           <tr><td><b>Dispatched Through </b></td><td>:</td><td>${record.custbody_jj_dispatch_through}</td></tr>
           <tr><td><b>Destination </b></td><td>:</td><td>${record.shipcity}</td></tr>
          <tr><td><b>Term of Delivery </b></td><td>:</td><td>${record.custbody7}</td></tr> </table></td></tr></table>
    <table style="width: 100%; margin-top: 20px;">
                <tr>
                    <td class="addressheader" colspan="4"><b>${record.billaddress@label}</b></td>
                    <td class="addressheader" colspan="3"><b>${record.shipaddress@label}</b></td>
                    <td class="totalboxtop" colspan="6"><b>${record.total@label?upper_case}</b></td>
                </tr>
                <tr>
                     <td class="address" colspan="4" rowspan="2">${record.billaddress}
      </td>
                    <td class="address" colspan="3" rowspan="2">${record.shipaddress}</td>
                    <td align="right" class="totalboxmid" colspan="6">${record.total}</td>
                </tr>
                <tr>
                </tr>
            </table>
<p align="left" style="  font-size: 8pt;">
      <b>Email:</b> ${record.entity.email}
      </p>
      <p align="left" style="  font-size: 8pt;">
        <b>Phone:</b> ${record.entity.phone}
      </p>
<table class="body" style="width: 100%; margin-top: 10px;"><tr>
    
    <th>Place of Supply</th>
    <th>${record.salesrep@label}</th>
  <th><p align="right">${record.shipmethod@label}</p></th>
    
    </tr>
    <tr>
      <td>${record.custbody_in_place_of_supply}</td>
    <td>${record.salesrep}</td>
      <td><p align="right">${record.custbody_jj_shipping_method}</p></td>
    
    </tr></table>
   <#assign count = 0>
  <#list record.item as item>
	<#if item.itemtype?contains("Group") >
       <#assign count = 1>
      </#if>
    </#list> 
    
    
 
<#if record.item?has_content && count = 0>

<#assign index = 0>
<table font-size="7" class="itemtable" style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item><#if item_index==0>
<thead>
	<tr>
	<th colspan="4">SNo.</th>
      <th colspan="16"><p align="left">Item Code Description</p></th>
      <th colspan="8"><p align="left">HSN/SAC</p></th>
       <th colspan="6"><p align="left">UOM</p></th>
    <th align="center" colspan="5">Qty</th>
	<th align="right" colspan="12">${item.rate@label}</th>
	<th align="right" colspan="12">${item.amount@label}</th>
	<th align="right" colspan="8" style="padding: 10px 6px; white-space: nowrap;">${item.taxrate@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.taxamount@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.grossamt@label}</th>
	</tr>
</thead>
  </#if><#if item.itemtype != 'OthCharge'><#if item.custcol_jj_substitute_item?contains("Yes")><tr><td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.custcol_jj_me102_substitute_item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.custcol_jj_me102_substitute_item_des}</td>
	<td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr> <#else><tr>
  <td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.description}</td>
  <td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr></#if></#if>
  </#list><!-- end items --></table><hr style="width: 100%; color: #d3d3d3; background-color: #d3d3d3; height: 1px;" /></#if>
  <#if record.item?has_content && count = 1>

<#assign index = 0>
<table font-size="7" class="itemtable" style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item><#if item_index==0>
<thead>
	<tr>
	<th colspan="4">SNo.</th>
      <th colspan="16"><p align="left">Item Code Description</p></th>
      <th colspan="8"><p align="left">HSN/SAC</p></th>
       <th colspan="6"><p align="left">UOM</p></th>
    <th align="center" colspan="5">Qty</th>
	<th align="right" colspan="12">${item.rate@label}</th>
	<th align="right" colspan="12">${item.amount@label}</th>
	<th align="right" colspan="8" style="padding: 10px 6px; white-space: nowrap;">${item.taxrate@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.taxamount@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.grossamt@label}</th>
	</tr>
</thead>
  </#if><#if item.itemtype != 'OthCharge'><#if item.itemtype !='Group' && item.itemtype !='EndGroup'  && item.custcol_jj_me71_show_item?string=="Yes" ><#if item.custcol_jj_substitute_item?contains("Yes")><tr><td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.custcol_jj_me102_substitute_item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.custcol_jj_me102_substitute_item_des}</td>
	<td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr> <#else><tr>
  <td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.description}</td>
  <td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr></#if></#if></#if>
  </#list><!-- end items --></table></#if>


  <!-- start Tax Summary --><#if record.item?has_content>
<table style="width: 100%; margin-top: 10px;"><#list record.taxsummary as tax><#if tax_index==0><tr>
    <th >${tax.taxtype@label}</th>
    <th colspan="2" >${tax.taxcode@label}</th>
    <th >${tax.taxbasis@label}</th>
    <th>${tax.taxrate@label}</th>
    <th>${tax.taxamount@label}</th>
    </tr>
    </#if>
    <tr>
    <td>${tax.taxtype}</td>
    <td colspan="2">${tax.taxcode}</td>
    <td>${tax.taxbasis}</td>
    <td>${tax.taxrate}</td>
    <td>${tax.taxamount}</td>
    </tr>
    </#list>
    </table>

</#if><!-- end Tax Summary -->
   <#assign chargeAmt = 0>
  <#list record.item as item>
	<#if item.itemtype =='OthCharge' >
       <#assign chargeAmt = chargeAmt + item.amount>
      </#if>
    </#list>


  <table style="page-break-inside: avoid; width: 100%; margin-top: 10px;"><tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.subtotal@label}</td>
    <td align="right"><#if chargeAmt !=0 ><#assign subchargeAmt = record.subtotal - chargeAmt>${currency[record.currency]}${subchargeAmt?string["0.00"]}<#else>${record.subtotal}</#if></td>
    </tr>
   <#list record.item as item>
   <#if item.itemtype =='OthCharge' >
       <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${item.item}</td>
  <td align="right">${item.amount}</td>
    </tr>
      </#if>
    </#list>
  <#if record.taxtotal2?has_content >
   <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">IGST</td>
    <td align="right">${record.taxtotal2}</td>
    </tr></#if>
   <#if record.taxtotal5?has_content >
  <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">UTGST</td>
    <td align="right">${record.taxtotal5}</td>
     </tr></#if>
   <#if record.taxtotal3?has_content >
  <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">CGST</td>
    <td align="right">${record.taxtotal3}</td>
     </tr></#if>
  
    <!--<tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.taxtotal@label}</td>
    <td align="right">${record.taxtotal}</td>
    </tr>-->
    <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">Round Off</td>
      <td align="right"><#assign round = record.total?round ><#assign round = record.total - round >${currency[record.currency]}
 ${round?string["##0.00"]}</td>
    </tr>
    <tr style="background-color: #e3e3e3; line-height: 200%;">
    <td background-color="#ffffff" colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.total@label}</td>
    <td align="right">${record.total}</td>
    </tr></table>
<!--<table class="total" style="width: 100%; margin-top: 10px;"><tr>
    <td colspan="4"> </td>
    <td align="right"><b>${record.subtotal@label}</b></td>
    <td align="right">${record.subtotal}</td>
    </tr>
    <tr>
    <td colspan="4"> </td>
    <td align="right"><b>${record.taxtotal@label}</b></td>
    <td align="right">${record.taxtotal}</td>
    </tr>
    <tr class="totalrow">
    <td background-color="#ffffff" colspan="4"> </td>
    <td align="right"><b>${record.total@label}</b></td>
    <td align="right">${record.total}</td>
  </tr></table>-->
  <table width="100%"><tr><td align="left" colspan="2"><p font-size="8">Amount (in words): <b>${record.custbody_amount_in_wrds}</b></p><p font-size="8">Company's PAN: <b> AAJPK0556E</b></p><#if record.entity.custentity_in_gst_vendor_regist_type =='SEZ' || record.entity.custentity_in_gst_vendor_regist_type =='Overseas'><br/><br/><br/><br/><p>Declaration</p><p>1) Supply meant for SEZ unit/ SEZ Developers with the
payment of IGST</p>
<p>2) Supply meant for SEZ unit/SEZ Developers with filing of
LUT No.</p>
<p>3) Supply meant for Export with the payment of IGST</p>
<p>4) Supply meant for Export with filing of LUT No.</p>
<p>5) Supply meant for Export with filling of Bond </p><#else>
  <br/><br/><br/><br/><br/><br/><br/><p>Declaration</p><p>i. The above goods are sent in perfect order and condition.
</p>
  <p>ii. Goods once sold will not be accepted back.</p>
<p>iii. Interest@ 24% p.a. will be charged if not paid as per agreed payment terms.
</p><p>iv. The property in the goods will not be transferred unless 100% payment is made.</p></#if></td><td>
  <table><tr><td align="left"><p font-size="10">Company's Bank Details</p></td></tr>
    <tr><td><table style="padding-left:-6px;"><tr><td><p>Bank Name</p></td><td>:</td><td>${companyInformation.custrecord1}</td></tr><tr><td><p>A/C No.</p></td><td>:</td><td>${companyInformation.custrecord2}</td></tr><tr><td><p>Bank & IFSC Code</p></td><td>:</td><td>${companyInformation.custrecord3} </td></tr><tr><td><table style="margin-top:10px;page-break-inside: avoid;" class="invoicebox"><tr><td><p align="left" >For Manglam Electricals</p></td></tr><tr><td><p align="right"></p></td></tr><tr><td><p align="right"></p></td></tr><tr><td><p align="right">Authorised Signatory </p></td></tr></table></td></tr></table></td></tr></table></td></tr></table>
  
</body>
</pdf>
  <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">
          <#assign count = 0>
          <#list record.item as item><#if item.itemtype == 'Service'> <#assign count =1> </#if></#list>
           <table width="100%"><tr><td align="left" style="padding-top:-10px;"> 
                             <img src="https://system.netsuite.com/core/media/media.nl?id=4406&c=5318034_SB1&h=d6cfe6693b342d031655" style="padding-left:-5px;width:220px;height:80px" />
             <p style="padding-top:-10px;" ><b>${companyInformation.companyName}</b></p>
             <p align="left" font-size="9" style="padding-top:-10px;">1826/II/23 New Amarnath Building</p>
<p align="left" font-size="9" style="padding-top:-10px;">Bhagirath Palace</p>
<p align="left" font-size="9" style="padding-top:-10px;">Chandni Chowk Delhi 110006</p>
<p align="left" font-size="9" style="padding-top:-10px;">India</p>
             <p align="left" font-size="9" style="padding-top:-10px;"><b>GSTIN:</b> 07AAJPK0556E1ZX</p>
             <p align="left" font-size="9" style="padding-top:-10px;"><b>State Code:</b> 07</p>
               <p align="left" font-size="9" style="padding-top:-10px;"><b>Email:</b> sales@manglamelectricals.com</p>
             </td><td align="right"><p style="padding-top:-2px;">(TRIPLICATE FOR SUPPLIER)</p><#if record.entity.custentity_in_gst_vendor_regist_type =='SEZ' || record.entity.custentity_in_gst_vendor_regist_type =='Overseas' && count = 0><span class="title">Export Invoice</span><#else><span class="title">Tax Invoice</span></#if>
             <p font-size="10" ><b>Invoice No:</b> ${record.tranid}</p> <p  font-size="10"><b>Date:</b> ${record.trandate}</p></td></tr> </table>
          
          
 
        </macro>
        <macro id="nlfooter">
          
            <table class="footer" style="width: 100%;"><tr>
              <td><barcode codetype="code128" showtext="true" value="${record.tranid}"/></td>
    <td align="right"><pagenumber/> of <totalpages/></td>
    </tr></table>
       <p font-size="9" align="center" >This is a Computer Generated Invoice</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;
            background-color: #e3e3e3;
            color: #333333;
        }
        td {
            padding: 4px 6px;
        }
        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: 8pt;
        }
        table.itemtable th {
            padding-bottom: 10px;
            padding-top: 10px;
        }
        table.body td {
            padding-top: 2px;
        }
        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;
        }
        td.address {
            padding-top: 0px;
        }
        td.totalboxmid {
            font-size: 28pt;
            padding-top: 20px;
            background-color: #e3e3e3;
        }
        td.totalboxbot {
            background-color: #e3e3e3;
            font-weight: bold;
        }
        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;
        }
        .invoicebox
      {
        border:1px; border-color:#000000; margin-top:2px;width:211px;padding-bottom:0px;padding-top:1px;min-height:100px;max-height:100px;
      }
</style>
</head>
<body header="nlheader" header-height="20%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
  <#assign currency={"US Dollar":"$", "Euro" :"€", "British pound" :"£", "Indian Rupee" :"₹"}>

          <table align="left" width="100%"  style="padding-left:-5px;margin-top:15px;"><tr><td><table>
          <tr><td><b>Delivery Note No. </b></td><td>:</td><td>${record.custbody1}</td></tr>
          <tr><td><b>Delivery Note Date </b></td><td>:</td><td>${record.custbody2}</td></tr>
          <tr><td><b>Due Date </b></td><td>:</td><td>${record.duedate}</td></tr>
          <tr><td><b>Your Order Ref </b></td><td>:</td><td>${record.otherrefnum}</td></tr>
          <tr><td><b>PO Date </b></td><td>:</td><td>${record.custbody3}</td></tr>
          </table></td>
      <td><table>
           <tr><td><b>Mode/Terms of Payment </b></td><td>:</td><td>${record.terms}</td></tr>
            <tr><td><b>Dispatch Document No. </b></td><td>:</td><td>${record.custbody6}</td></tr>
           <tr><td><b>Dispatched Through </b></td><td>:</td><td>${record.custbody_jj_dispatch_through}</td></tr>
           <tr><td><b>Destination </b></td><td>:</td><td>${record.shipcity}</td></tr>
          <tr><td><b>Term of Delivery </b></td><td>:</td><td>${record.custbody7}</td></tr> </table></td></tr></table>
    <table style="width: 100%; margin-top: 20px;">
                <tr>
                    <td class="addressheader" colspan="4"><b>${record.billaddress@label}</b></td>
                    <td class="addressheader" colspan="3"><b>${record.shipaddress@label}</b></td>
                    <td class="totalboxtop" colspan="6"><b>${record.total@label?upper_case}</b></td>
                </tr>
                <tr>
                     <td class="address" colspan="4" rowspan="2">${record.billaddress}
      </td>
                    <td class="address" colspan="3" rowspan="2">${record.shipaddress}</td>
                    <td align="right" class="totalboxmid" colspan="6">${record.total}</td>
                </tr>
                <tr>
                </tr>
            </table>
    <p align="left" style="  font-size: 8pt;">
      <b>Email:</b> ${record.entity.email}
      </p>
      <p align="left" style="  font-size: 8pt;">
        <b>Phone:</b> ${record.entity.phone}
      </p>

<table class="body" style="width: 100%; margin-top: 10px;"><tr>
    
    <th>Place of Supply</th>
    <th>${record.salesrep@label}</th>
  <th><p align="right">${record.shipmethod@label}</p></th>
    
    </tr>
    <tr>
      <td>${record.custbody_in_place_of_supply}</td>
    <td>${record.salesrep}</td>
      <td><p align="right">${record.custbody_jj_shipping_method}</p></td>
    
    </tr></table>
   <#assign count = 0>
  <#list record.item as item>
	<#if item.itemtype?contains("Group") >
       <#assign count = 1>
      </#if>
    </#list> 
    
    
 
<#if record.item?has_content && count = 0>

<#assign index = 0>
<table font-size="7" class="itemtable" style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item><#if item_index==0>
<thead>
	<tr>
	<th colspan="4">SNo.</th>
      <th colspan="16"><p align="left">Item Code Description</p></th>
      <th colspan="8"><p align="left">HSN/SAC</p></th>
       <th colspan="6"><p align="left">UOM</p></th>
    <th align="center" colspan="5">Qty</th>
	<th align="right" colspan="12">${item.rate@label}</th>
	<th align="right" colspan="12">${item.amount@label}</th>
	<th align="right" colspan="8" style="padding: 10px 6px; white-space: nowrap;">${item.taxrate@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.taxamount@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.grossamt@label}</th>
	</tr>
</thead>
  </#if><#if item.itemtype != 'OthCharge'><#if item.custcol_jj_substitute_item?contains("Yes")><tr><td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.custcol_jj_me102_substitute_item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.custcol_jj_me102_substitute_item_des}</td>
	<td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr> <#else><tr>
  <td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.description}</td>
  <td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr></#if></#if>
  </#list><!-- end items --></table><hr style="width: 100%; color: #d3d3d3; background-color: #d3d3d3; height: 1px;" /></#if>
  <#if record.item?has_content && count = 1>

<#assign index = 0>
<table font-size="7" class="itemtable" style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item><#if item_index==0>
<thead>
	<tr>
	<th colspan="4">SNo.</th>
      <th colspan="16"><p align="left">Item Code Description</p></th>
      <th colspan="8"><p align="left">HSN/SAC</p></th>
       <th colspan="6"><p align="left">UOM</p></th>
    <th align="center" colspan="5">Qty</th>
	<th align="right" colspan="12">${item.rate@label}</th>
	<th align="right" colspan="12">${item.amount@label}</th>
	<th align="right" colspan="8" style="padding: 10px 6px; white-space: nowrap;">${item.taxrate@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.taxamount@label}</th>
	<th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">${item.grossamt@label}</th>
	</tr>
</thead>
  </#if><#if item.itemtype != 'OthCharge'><#if item.itemtype !='Group' && item.itemtype !='EndGroup'  && item.custcol_jj_me71_show_item?string=="Yes" ><#if item.custcol_jj_substitute_item?contains("Yes")><tr><td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.custcol_jj_me102_substitute_item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.custcol_jj_me102_substitute_item_des}</td>
	<td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr> <#else><tr>
  <td colspan="4"><#assign index=index+1>${index}</td>
  <td colspan="16" line-height="150%"><span class="itemname"><b>${item.item}</b></span><#if item.inventorydetail?has_content ><br/>${item.inventorydetail}</#if><br />${item.description}</td>
  <td colspan="8"><#if item.custcol_in_hsn_code?has_content>${item.custcol_in_hsn_code?keep_before(" ")}<#else>${item.custcol_in_hsn_code}</#if></td>
  <td colspan="6">${item.units}</td>
    <td align="center" colspan="5">${item.quantity}</td>
	<td align="right" colspan="12">${item.rate}</td>
	<td align="right" colspan="12">${item.amount}</td>
	<td align="right" colspan="8">${item.taxrate}</td>
	<td align="right" colspan="12">${item.taxamount}</td>
	<td align="right" colspan="12">${item.grossamt}</td>
  </tr></#if></#if></#if>
  </#list><!-- end items --></table></#if><!-- start Tax Summary --><#if record.item?has_content>
<table style="width: 100%; margin-top: 10px;"><#list record.taxsummary as tax><#if tax_index==0><tr>
    <th >${tax.taxtype@label}</th>
    <th colspan="2" >${tax.taxcode@label}</th>
    <th >${tax.taxbasis@label}</th>
    <th>${tax.taxrate@label}</th>
    <th>${tax.taxamount@label}</th>
    </tr>
    </#if>
    <tr>
    <td>${tax.taxtype}</td>
    <td colspan="2">${tax.taxcode}</td>
    <td>${tax.taxbasis}</td>
    <td>${tax.taxrate}</td>
    <td>${tax.taxamount}</td>
    </tr>
    </#list>
    </table>
</#if><!-- end Tax Summary -->
  
   <#assign chargeAmt = 0>
  <#list record.item as item>
	<#if item.itemtype =='OthCharge' >
       <#assign chargeAmt = chargeAmt + item.amount>
      </#if>
    </#list>


  <table style="page-break-inside: avoid; width: 100%; margin-top: 10px;"><tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.subtotal@label}</td>
    <td align="right"><#if chargeAmt !=0 ><#assign subchargeAmt = record.subtotal - chargeAmt>${currency[record.currency]}${subchargeAmt?string["0.00"]}<#else>${record.subtotal}</#if>
</td>
    </tr>
  <#list record.item as item>
   <#if item.itemtype =='OthCharge' >
       <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${item.item}</td>
  <td align="right">${item.amount}</td>
    </tr>
      </#if>
    </#list>

  <#if record.taxtotal2?has_content >
   <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">IGST</td>
    <td align="right">${record.taxtotal2}</td>
    </tr></#if>
   <#if record.taxtotal5?has_content >
  <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">UTGST</td>
    <td align="right">${record.taxtotal5}</td>
     </tr></#if>
   <#if record.taxtotal3?has_content >
  <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">CGST</td>
    <td align="right">${record.taxtotal3}</td>
     </tr></#if>
  
    <!--<tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.taxtotal@label}</td>
    <td align="right">${record.taxtotal}</td>
    </tr>-->
    <tr>
    <td colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">Round Off</td>
      <td align="right"><#assign round = record.total?round ><#assign round = record.total - round >${currency[record.currency]} ${round?string["##0.00"]}</td>
    </tr>
    <tr style="background-color: #e3e3e3; line-height: 200%;">
    <td background-color="#ffffff" colspan="4"> </td>
    <td align="right" style="font-weight: bold; color: #333333;">${record.total@label}</td>
    <td align="right">${record.total}</td>
    </tr></table>
<!--<table class="total" style="width: 100%; margin-top: 10px;"><tr>
    <td colspan="4"> </td>
    <td align="right"><b>${record.subtotal@label}</b></td>
    <td align="right">${record.subtotal}</td>
    </tr>
    <tr>
    <td colspan="4"> </td>
    <td align="right"><b>${record.taxtotal@label}</b></td>
    <td align="right">${record.taxtotal}</td>
    </tr>
    <tr class="totalrow">
    <td background-color="#ffffff" colspan="4"> </td>
    <td align="right"><b>${record.total@label}</b></td>
    <td align="right">${record.total}</td>
  </tr></table>-->
  <table width="100%"><tr><td align="left" colspan="2"><p font-size="8">Amount (in words): <b>${record.custbody_amount_in_wrds}</b></p><p font-size="8">Company's PAN: <b> AAJPK0556E</b></p><#if record.entity.custentity_in_gst_vendor_regist_type =='SEZ' || record.entity.custentity_in_gst_vendor_regist_type =='Overseas'><br/><br/><br/><br/><p>Declaration</p><p>1) Supply meant for SEZ unit/ SEZ Developers with the
payment of IGST</p>
<p>2) Supply meant for SEZ unit/SEZ Developers with filing of
LUT No.</p>
<p>3) Supply meant for Export with the payment of IGST</p>
<p>4) Supply meant for Export with filing of LUT No.</p>
<p>5) Supply meant for Export with filling of Bond </p><#else>
  <br/><br/><br/><br/><br/><br/><br/><p>Declaration</p><p>i. The above goods are sent in perfect order and condition.
</p>
  <p>ii. Goods once sold will not be accepted back.</p>
<p>iii. Interest@ 24% p.a. will be charged if not paid as per agreed payment terms.
</p><p>iv. The property in the goods will not be transferred unless 100% payment is made.</p>
    </#if></td><td>
  <table><tr><td align="left"><p font-size="10">Company's Bank Details</p></td></tr>
    <tr><td><table style="padding-left:-6px;"><tr><td><p>Bank Name</p></td><td>:</td><td>${companyInformation.custrecord1}</td></tr><tr><td><p>A/C No.</p></td><td>:</td><td>${companyInformation.custrecord2}</td></tr><tr><td><p>Bank & IFSC Code</p></td><td>:</td><td>${companyInformation.custrecord3} </td></tr><tr><td><table style="margin-top:10px;page-break-inside: avoid;" class="invoicebox"><tr><td><p align="left" >For Manglam Electricals</p></td></tr><tr><td><p align="right"></p></td></tr><tr><td><p align="right"></p></td></tr><tr><td><p align="right">Authorised Signatory </p></td></tr></table></td></tr></table></td></tr></table></td></tr></table>
  
</body>
</pdf>
  </pdfset>

Advanced PDF Template for Integrated Item Invoice

        
<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdfset>
    <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" />
            <macrolist>
                <macro id="nlheader">
                  <#assign count = 0>
          <#list record.item as item><#if item.itemtype == 'Service'> <#assign count =1> </#if></#list>
                    <table width="100%">
                        <tr>
                            <td align="left" style="padding-top:-10px;">
                                <img src="https://system.netsuite.com/core/media/media.nl?id=4406&c=5318034_SB1&h=d6cfe6693b342d031655" style="padding-left:-5px;width:220px;height:80px" />
                                <p style="padding-top:-10px;"><b>${companyInformation.companyName}</b></p>
                                <p align="left" font-size="9" style="padding-top:-10px;">1826/II/23 New Amarnath Building</p>
                                <p align="left" font-size="9" style="padding-top:-10px;">Bhagirath Palace</p>
                                <p align="left" font-size="9" style="padding-top:-10px;">Chandni Chowk Delhi 110006</p>
                                <p align="left" font-size="9" style="padding-top:-10px;">India</p>
                                <p align="left" font-size="9" style="padding-top:-10px;"><b>GSTIN:</b> 07AAJPK0556E1ZX</p>
                                <p align="left" font-size="9" style="padding-top:-10px;"><b>State Code:</b> 07</p>
                                <p align="left" font-size="9" style="padding-top:-10px;"><b>Email:</b> sales@manglamelectricals.com</p>
                            </td>
                            <td align="right">
                                <p style="padding-top:-2px;">(ORIGINAL FOR RECIPIENT)</p>
                                <#if record.entity.custentity_in_gst_vendor_regist_type=='SEZ' || record.entity.custentity_in_gst_vendor_regist_type=='Overseas' && count=0><span class="title">Export Invoice</span>
                                    <#else><span class="title">Tax Invoice</span>
                                </#if>
                                <p font-size="10"><b>Invoice No:</b> ${record.tranid}</p>
                                <p font-size="10"><b>Date:</b> ${record.trandate}</p>
                            </td>
                        </tr>
                    </table>
                </macro>
                <macro id="nlfooter">
                    <table class="footer" style="width: 100%;">
                        <tr>
                            <td>
                                <barcode codetype="code128" showtext="true" value="${record.tranid}" />
                            </td>
                            <td align="right">
                                <pagenumber /> of
                                <totalpages />
                            </td>
                        </tr>
                    </table>
                    <p font-size="9" align="center">This is a Computer Generated Invoice</p>
                </macro>
            </macrolist>
            <style type="text/css">
            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
            }

            b {
                font-weight: bold;
                color: #333333;
            }

            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;
            }

            table.body td {
                padding-top: 2px;
            }

            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;
            }

            td.address {
                padding-top: 0px;
            }

            td.totalboxmid {
                font-size: 28pt;
                padding-top: 20px;
                background-color: #e3e3e3;
            }

            td.totalboxbot {
                background-color: #e3e3e3;
                font-weight: bold;
            }

            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;
            }

            .invoicebox {
                border: 1px;
                border-color: #000000;
                margin-top: 2px;
                width: 211px;
                padding-bottom: 0px;
                padding-top: 1px;
                min-height: 100px;
                max-height: 100px;
            }
            </style>
        </head>

        <body header="nlheader" header-height="20%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
           <#assign currency={"US Dollar":"$", "Euro" :"€", "British pound" :"£", "Indian Rupee" :"₹"}>
            <table align="left" width="100%" style="padding-left:-5px;margin-top:15px;">
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td><b>Delivery Note No. </b></td>
                                <td>:</td>
                                <td>${record.custbody1}</td>
                            </tr>
                            <tr>
                                <td><b>Delivery Note Date </b></td>
                                <td>:</td>
                                <td>${record.custbody2}</td>
                            </tr>
                            <tr>
                                <td><b>Due Date </b></td>
                                <td>:</td>
                                <td>${record.duedate}</td>
                            </tr>
                            <tr>
                                <td><b>Your Order Ref </b></td>
                                <td>:</td>
                                <td>${record.otherrefnum}</td>
                            </tr>
                            <tr>
                                <td><b>PO Date </b></td>
                                <td>:</td>
                                <td>${record.custbody3}</td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        <table>
                            <tr>
                                <td><b>Mode/Terms of Payment </b></td>
                                <td>:</td>
                                <td>${record.terms}</td>
                            </tr>
                            <tr>
                                <td><b>Dispatch Document No. </b></td>
                                <td>:</td>
                                <td>${record.custbody6}</td>
                            </tr>
                            <tr>
                                <td><b>Dispatched Through </b></td>
                                <td>:</td>
                                <td>${record.custbody_jj_dispatch_through}</td>
                            </tr>
                            <tr>
                                <td><b>Destination </b></td>
                                <td>:</td>
                                <td>${record.shipcity}</td>
                            </tr>
                            <tr>
                                <td><b>Term of Delivery </b></td>
                                <td>:</td>
                                <td>${record.custbody_str_delivery_terms}</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <table style="width: 100%; margin-top: 20px;">
                <tr>
                    <td class="addressheader" colspan="4"><b>${record.billaddress@label}</b></td>
                    <td class="addressheader" colspan="3"><b>${record.shipaddress@label}</b></td>
                    <td class="totalboxtop" colspan="6"><b>${record.total@label?upper_case}</b></td>
                </tr>
                <tr>
                     <td class="address" colspan="4" rowspan="2">${record.billaddress}
      </td>
                    <td class="address" colspan="3" rowspan="2">${record.shipaddress}</td>
                    <td align="right" class="totalboxmid" colspan="6">${currency[record.currency]} ${record.total}</td>
                </tr>
                <tr>
                </tr>
            </table>
             <p>
      <b>Email:</b> ${record.entity.email}
      </p>
      <p>
        <b>Phone:</b> ${record.entity.phone}
      </p>
            <table class="body" style="width: 100%; margin-top: 10px;">
                <tr>
                    <th>Place of Supply</th>
                    <th>${record.salesrep@label}</th>
                    <th>
                        <p align="right">${record.shipmethod@label}</p>
                    </th>
                </tr>
                <tr>
                    <td>${record.custpage_in_place_of_supply}</td>
                    <td>${record.salesrep}</td>
                    <td>
                        <p align="right">${record.custbody_jj_shipping_method}</p>
                    </td>
                </tr>
            </table>
            <#if record.item?has_content>
                <#assign index=0>
                    <table font-size="8" class="itemtable" style="width: 100%; margin-top: 10px;">
                        <!-- start items -->
                        <#list items.items as item>
                            <#if item_index==0>
                                <thead>
                                    <tr>
                                        <th colspan="4">SNo.</th>
                                        <th colspan="16">Item Code Description</th>
                                        <th colspan="8">
                                            <p align="left">HSN/SAC</p>
                                        </th>
                                        <th colspan="6">
                                            <p align="left">UOM</p>
                                        </th>
                                        <th align="center" colspan="5">Qty</th>
                                        <th align="right" colspan="12">Rate</th>
                                        <th align="right" colspan="12">Amount</th>
                                        <th align="right" colspan="8" style="padding: 10px 6px; white-space: nowrap;">Tax Rate</th>
                                        <th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">Tax Amount</th>
                                        <th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">Gross Amount</th>
                                    </tr>
                                </thead>
                            </#if>
                            <tr>
                                <td colspan="4">
                                    <#assign index=index+1>${index}
                                </td>
                                <td colspan="16" line-height="150%"><span class="itemname">${item.item}</span><br />${item.components}<br />${item.description}
                                </td>
                                <td colspan="8">${item.hsncode}</td>
                                <td colspan="6">${item.unit}</td>
                                <td align="center" colspan="5">${item.quantity}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.rate}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.amount}</td>
                                <td align="right" colspan="8">${item.taxrate}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.taxamount}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.grossamt}</td>
                            </tr>
                        </#list><!-- end items -->
                    </table>
                    <hr />
            </#if><!-- start Tax Summary -->
            <#if record.item?has_content>
                <table style="width: 100%; margin-top: 10px;">
                    <#list record.taxsummary as tax>
                        <#if tax_index==0>
                            <tr>
                                <th>${tax.taxtype@label}</th>
                                <th colspan="2">${tax.taxcode@label}</th>
                                <th>${tax.taxbasis@label}</th>
                                <th>${tax.taxrate@label}</th>
                                <th>${tax.taxamount@label}</th>
                            </tr>
                        </#if>
                        <tr>
                            <td>${tax.taxtype}</td>
                            <td colspan="2">${tax.taxcode}</td>
                            <td>${currency[record.currency]}${tax.taxbasis}</td>
                            <td>${tax.taxrate}</td>
                            <td>${currency[record.currency]}${tax.taxamount}</td>
                        </tr>
                    </#list>
                </table>
            
            </#if><!-- end Tax Summary -->
               <#assign chargeAmt = 0>
  <#list record.item as item>
	<#if item.itemtype =='OthCharge' >
       <#assign chargeAmt = chargeAmt + item.amount>
      </#if>
    </#list>

              
        
              <table style="page-break-inside: avoid; width: 100%; margin-top: 10px;"><tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${record.subtotal@label}</td>
  <td align="right"><#if chargeAmt !=0 ><#assign subchargeAmt = record.subtotal - chargeAmt>${currency[record.currency]}${subchargeAmt?string["0.00"]}<#else>${currency[record.currency]}${record.subtotal}</#if></td>
  </tr>
   <#list record.item as item>
   <#if item.itemtype =='OthCharge' >
       <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${item.item}</td>
  <td align="right">${item.amount}</td>
    </tr>
      </#if>
    </#list>

  <#if record.taxtotal2?has_content >
   <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">IGST</td>
  <td align="right">${currency[record.currency]}${record.taxtotal2}</td>
    </tr></#if>
   <#if record.taxtotal5?has_content >
  <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">UTGST</td>
  <td align="right">${currency[record.currency]}${record.taxtotal5}</td>
     </tr></#if>
   <#if record.taxtotal3?has_content >
  <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">CGST</td>
  <td align="right">${currency[record.currency]}${record.taxtotal3}</td>
     </tr></#if>

    <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">Round Off</td>
      <td align="right"><#assign round = record.total?round ><#assign round = record.total - round >${currency[record.currency]} ${round?string["##0.00"]}</td>
  </tr>
  <tr style="background-color: #e3e3e3; line-height: 200%;">
  <td background-color="#ffffff" colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${record.total@label}</td>
  <td align="right">${currency[record.currency]}${record.total}</td>
  </tr></table>
            <table width="100%">
                <tr>
                    <td align="left" colspan="2">
                        <p font-size="9">Amount (in words): <b>${record.custbody_amount_in_wrds}</b></p>
                        <p font-size="9">Company's PAN: <b> AAJPK0556E</b></p>
                        <#if record.entity.custentity_in_gst_vendor_regist_type=='SEZ' || record.entity.custentity_in_gst_vendor_regist_type=='Overseas'><br /><br /><br /><br />
                            <p>Declaration</p>
                            <p>1) Supply meant for SEZ unit/ SEZ Developers with the
                                payment of IGST</p>
                            <p>2) Supply meant for SEZ unit/SEZ Developers with filing of
                                LUT No.</p>
                            <p>3) Supply meant for Export with the payment of IGST</p>
                            <p>4) Supply meant for Export with filing of LUT No.</p>
                            <p>5) Supply meant for Export with filling of Bond </p>
                            <#else>
                                <br /><br /><br /><br /><br /><br /><br />
                                <p>Declaration</p>
                                <p>1) Received the above goods in perfect order & condition</p>
                                <p>2) Goods once sold will not be accepted back.</p>
                                <p>3) Interest@ 24% will be charged if not paid as per payment
                                    terms.</p>
                        </#if>
                    </td>
                    <td>
                        <table>
                            <tr>
                                <td align="left">
                                    <p font-size="10">Company's Bank Details</p>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table style="padding-left:-6px;">
                                        <tr>
                                            <td>
                                                <p>Bank Name</p>
                                            </td>
                                            <td>:</td>
                                            <td>${companyInformation.custrecord1}</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p>A/C No.</p>
                                            </td>
                                            <td>:</td><td>${companyInformation.custrecord2}</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p>Bank & IFSC Code</p>
                                            </td>
                                            <td>:</td><td>${companyInformation.custrecord3} </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table style="margin-top:10px;" class="invoicebox">
                                                    <tr>
                                                        <td>
                                                            <p align="left">For Manglam Electricals</p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <p align="right"></p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <p align="right"></p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <p align="right">Authorised Signatory </p>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </body>
    </pdf>
  <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" />
            <macrolist>
                <macro id="nlheader">
                  <#assign count = 0>
          <#list record.item as item><#if item.itemtype == 'Service'> <#assign count =1> </#if></#list>
                    <table width="100%">
                        <tr>
                            <td align="left" style="padding-top:-10px;">
                                <img src="https://system.netsuite.com/core/media/media.nl?id=4406&c=5318034_SB1&h=d6cfe6693b342d031655" style="padding-left:-5px;width:220px;height:80px" />
                                <p style="padding-top:-10px;"><b>${companyInformation.companyName}</b></p>
                                <p align="left" font-size="9" style="padding-top:-10px;">1826/II/23 New Amarnath Building</p>
                                <p align="left" font-size="9" style="padding-top:-10px;">Bhagirath Palace</p>
                                <p align="left" font-size="9" style="padding-top:-10px;">Chandni Chowk Delhi 110006</p>
                                <p align="left" font-size="9" style="padding-top:-10px;">India</p>
                                <p align="left" font-size="9" style="padding-top:-10px;"><b>GSTIN:</b> 07AAJPK0556E1ZX</p>
                                <p align="left" font-size="9" style="padding-top:-10px;"><b>State Code:</b> 07</p>
                                <p align="left" font-size="9" style="padding-top:-10px;"><b>Email:</b> sales@manglamelectricals.com</p>
                            </td>
                            <td align="right">
                                <p style="padding-top:-2px;">(DUPLICATE FOR TRANSPORTER)</p>
                                <#if record.entity.custentity_in_gst_vendor_regist_type=='SEZ' || record.entity.custentity_in_gst_vendor_regist_type=='Overseas' && count=0><span class="title">Export Invoice</span>
                                    <#else><span class="title">Tax Invoice</span>
                                </#if>
                                <p font-size="10"><b>Invoice No:</b> ${record.tranid}</p>
                                <p font-size="10"><b>Date:</b> ${record.trandate}</p>
                            </td>
                        </tr>
                    </table>
                </macro>
                <macro id="nlfooter">
                    <table class="footer" style="width: 100%;">
                        <tr>
                            <td>
                                <barcode codetype="code128" showtext="true" value="${record.tranid}" />
                            </td>
                            <td align="right">
                                <pagenumber /> of
                                <totalpages />
                            </td>
                        </tr>
                    </table>
                    <p font-size="9" align="center">This is a Computer Generated Invoice</p>
                </macro>
            </macrolist>
            <style type="text/css">
            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
            }

            b {
                font-weight: bold;
                color: #333333;
            }

            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;
            }

            table.body td {
                padding-top: 2px;
            }

            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;
            }

            td.address {
                padding-top: 0px;
            }

            td.totalboxmid {
                font-size: 28pt;
                padding-top: 20px;
                background-color: #e3e3e3;
            }

            td.totalboxbot {
                background-color: #e3e3e3;
                font-weight: bold;
            }

            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;
            }

            .invoicebox {
                border: 1px;
                border-color: #000000;
                margin-top: 2px;
                width: 211px;
                padding-bottom: 0px;
                padding-top: 1px;
                min-height: 100px;
                max-height: 100px;
            }
            </style>
        </head>

        <body header="nlheader" header-height="20%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
            <#assign currency={"US Dollar":"$", "Euro" :"€", "British pound" :"£", "Indian Rupee" :"₹"}>
            <table align="left" width="100%" style="padding-left:-5px;margin-top:15px;">
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td><b>Delivery Note No. </b></td>
                                <td>:</td>
                                <td>${record.custbody1}</td>
                            </tr>
                            <tr>
                                <td><b>Delivery Note Date </b></td>
                                <td>:</td>
                                <td>${record.custbody2}</td>
                            </tr>
                            <tr>
                                <td><b>Due Date </b></td>
                                <td>:</td>
                                <td>${record.duedate}</td>
                            </tr>
                            <tr>
                                <td><b>Your Order Ref </b></td>
                                <td>:</td>
                                <td>${record.otherrefnum}</td>
                            </tr>
                            <tr>
                                <td><b>PO Date </b></td>
                                <td>:</td>
                                <td>${record.custbody3}</td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        <table>
                            <tr>
                                <td><b>Mode/Terms of Payment </b></td>
                                <td>:</td>
                                <td>${record.terms}</td>
                            </tr>
                            <tr>
                                <td><b>Dispatch Document No. </b></td>
                                <td>:</td>
                                <td>${record.custbody6}</td>
                            </tr>
                            <tr>
                                <td><b>Dispatched Through </b></td>
                                <td>:</td>
                                <td>${record.custbody_jj_dispatch_through}</td>
                            </tr>
                            <tr>
                                <td><b>Destination </b></td>
                                <td>:</td>
                                <td>${record.shipcity}</td>
                            </tr>
                            <tr>
                                <td><b>Term of Delivery </b></td>
                                <td>:</td>
                                <td>${record.custbody_str_delivery_terms}</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <table style="width: 100%; margin-top: 20px;">
                <tr>
                    <td class="addressheader" colspan="4"><b>${record.billaddress@label}</b></td>
                    <td class="addressheader" colspan="3"><b>${record.shipaddress@label}</b></td>
                    <td class="totalboxtop" colspan="6"><b>${record.total@label?upper_case}</b></td>
                </tr>
                <tr>
                     <td class="address" colspan="4" rowspan="2">${record.billaddress}
      </td>
                    <td class="address" colspan="3" rowspan="2">${record.shipaddress}</td>
                    <td align="right" class="totalboxmid" colspan="6">${currency[record.currency]} ${record.total}</td>
                </tr>
                <tr>
                </tr>
            </table>
              <p>
      <b>Email:</b> ${record.entity.email}
      </p>
      <p>
        <b>Phone:</b> ${record.entity.phone}
      </p>
            <table class="body" style="width: 100%; margin-top: 10px;">
                <tr>
                    <th>Place of Supply</th>
                    <th>${record.salesrep@label}</th>
                    <th>
                        <p align="right">${record.shipmethod@label}</p>
                    </th>
                </tr>
                <tr>
                    <td>${record.custpage_in_place_of_supply}</td>
                    <td>${record.salesrep}</td>
                    <td>
                        <p align="right">${record.custbody_jj_shipping_method}</p>
                    </td>
                </tr>
            </table>
            <#if record.item?has_content>
                <#assign index=0>
                    <table font-size="8" class="itemtable" style="width: 100%; margin-top: 10px;">
                        <!-- start items -->
                        <#list items.items as item>
                            <#if item_index==0>
                                <thead>
                                    <tr>
                                        <th colspan="4">SNo.</th>
                                        <th colspan="16">Item Code Description</th>
                                        <th colspan="8">
                                            <p align="left">HSN/SAC</p>
                                        </th>
                                        <th colspan="6">
                                            <p align="left">UOM</p>
                                        </th>
                                        <th align="center" colspan="5">Qty</th>
                                        <th align="right" colspan="12">Rate</th>
                                        <th align="right" colspan="12">Amount</th>
                                        <th align="right" colspan="8" style="padding: 10px 6px; white-space: nowrap;">Tax Rate</th>
                                        <th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">Tax Amount</th>
                                        <th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">Gross Amount</th>
                                    </tr>
                                </thead>
                            </#if>
                            <tr>
                                <td colspan="4">
                                    <#assign index=index+1>${index}
                                </td>
                                <td colspan="16" line-height="150%"><span class="itemname">${item.item}</span><br />${item.components}<br />${item.description}
                                </td>
                                <td colspan="8">${item.hsncode}</td>
                                <td colspan="6">${item.unit}</td>
                                <td align="center" colspan="5">${item.quantity}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.rate}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.amount}</td>
                                <td align="right" colspan="8">${item.taxrate}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.taxamount}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.grossamt}</td>
                            </tr>
                        </#list><!-- end items -->
                    </table>
                    <hr />
            </#if><!-- start Tax Summary -->
            <#if record.item?has_content>
                <table style="width: 100%; margin-top: 10px;">
                    <#list record.taxsummary as tax>
                        <#if tax_index==0>
                            <tr>
                                <th>${tax.taxtype@label}</th>
                                <th colspan="2">${tax.taxcode@label}</th>
                                <th>${tax.taxbasis@label}</th>
                                <th>${tax.taxrate@label}</th>
                                <th>${tax.taxamount@label}</th>
                            </tr>
                        </#if>
                        <tr>
                            <td>${tax.taxtype}</td>
                            <td colspan="2">${tax.taxcode}</td>
                            <td>${currency[record.currency]} ${tax.taxbasis}</td>
                            <td>${tax.taxrate}</td>
                            <td>${currency[record.currency]} ${tax.taxamount}</td>
                        </tr>
                    </#list>
                </table>
              
            </#if><!-- end Tax Summary -->
               <#assign chargeAmt = 0>
  <#list record.item as item>
	<#if item.itemtype =='OthCharge' >
       <#assign chargeAmt = chargeAmt + item.amount>
      </#if>
    </#list>

        
              <table style="page-break-inside: avoid; width: 100%; margin-top: 10px;"><tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${record.subtotal@label}</td>
  <td align="right"><#if chargeAmt !=0 ><#assign subchargeAmt = record.subtotal - chargeAmt>${currency[record.currency]}${subchargeAmt?string["0.00"]}<#else>${currency[record.currency]}${record.subtotal}</#if></td>
  </tr>

    <#list record.item as item>
   <#if item.itemtype =='OthCharge' >
       <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${item.item}</td>
  <td align="right">${item.amount}</td>
    </tr>
      </#if>
    </#list>

  <#if record.taxtotal2?has_content >
   <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">IGST</td>
  <td align="right">${currency[record.currency]}${record.taxtotal2}</td>
    </tr></#if>
   <#if record.taxtotal5?has_content >
  <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">UTGST</td>
  <td align="right">${currency[record.currency]}${record.taxtotal5}</td>
     </tr></#if>
   <#if record.taxtotal3?has_content >
  <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">CGST</td>
  <td align="right">${currency[record.currency]}${record.taxtotal3}</td>
     </tr></#if>
    <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">Round Off</td>
      <td align="right"><#assign round = record.total?round ><#assign round = record.total - round >${currency[record.currency]} ${round?string["##0.00"]}</td>
  </tr>
  <tr style="background-color: #e3e3e3; line-height: 200%;">
  <td background-color="#ffffff" colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${record.total@label}</td>
  <td align="right">${currency[record.currency]}${record.total}</td>
  </tr></table>
            <table width="100%">
                <tr>
                    <td align="left" colspan="2">
                        <p font-size="9">Amount (in words): <b>${record.custbody_amount_in_wrds}</b></p>
                        <p font-size="9">Company's PAN: <b> AAJPK0556E</b></p>
                        <#if record.entity.custentity_in_gst_vendor_regist_type=='SEZ' || record.entity.custentity_in_gst_vendor_regist_type=='Overseas'><br /><br /><br /><br />
                            <p>Declaration</p>
                            <p>1) Supply meant for SEZ unit/ SEZ Developers with the
                                payment of IGST</p>
                            <p>2) Supply meant for SEZ unit/SEZ Developers with filing of
                                LUT No.</p>
                            <p>3) Supply meant for Export with the payment of IGST</p>
                            <p>4) Supply meant for Export with filing of LUT No.</p>
                            <p>5) Supply meant for Export with filling of Bond </p>
                            <#else>
                                <br /><br /><br /><br /><br /><br /><br />
                                <p>Declaration</p>
                                <p>1) Received the above goods in perfect order & condition</p>
                                <p>2) Goods once sold will not be accepted back.</p>
                                <p>3) Interest@ 24% will be charged if not paid as per payment
                                    terms.</p>
                        </#if>
                    </td>
                    <td>
                        <table>
                            <tr>
                                <td align="left">
                                    <p font-size="10">Company's Bank Details</p>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table style="padding-left:-6px;">
                                        <tr>
                                            <td>
                                                <p>Bank Name</p>
                                            </td>
                                            <td>:</td>
                                            <td>${companyInformation.custrecord1}</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p>A/C No.</p>
                                            </td>
                                            <td>:</td><td>${companyInformation.custrecord2}</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p>Bank & IFSC Code</p>
                                            </td>
                                            <td>:</td><td>${companyInformation.custrecord3} </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table style="margin-top:10px;" class="invoicebox">
                                                    <tr>
                                                        <td>
                                                            <p align="left">For Manglam Electricals</p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <p align="right"></p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <p align="right"></p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <p align="right">Authorised Signatory </p>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </body>
    </pdf>
          <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" />
            <macrolist>
                <macro id="nlheader">
                  <#assign count = 0>
          <#list record.item as item><#if item.itemtype == 'Service'> <#assign count =1> </#if></#list>
                    <table width="100%">
                        <tr>
                            <td align="left" style="padding-top:-10px;">
                                <img src="https://system.netsuite.com/core/media/media.nl?id=4406&c=5318034_SB1&h=d6cfe6693b342d031655" style="padding-left:-5px;width:220px;height:80px" />
                                <p style="padding-top:-10px;"><b>${companyInformation.companyName}</b></p>
                                <p align="left" font-size="9" style="padding-top:-10px;">1826/II/23 New Amarnath Building</p>
                                <p align="left" font-size="9" style="padding-top:-10px;">Bhagirath Palace</p>
                                <p align="left" font-size="9" style="padding-top:-10px;">Chandni Chowk Delhi 110006</p>
                                <p align="left" font-size="9" style="padding-top:-10px;">India</p>
                                <p align="left" font-size="9" style="padding-top:-10px;"><b>GSTIN:</b> 07AAJPK0556E1ZX</p>
                                <p align="left" font-size="9" style="padding-top:-10px;"><b>State Code:</b> 07</p>
                                <p align="left" font-size="9" style="padding-top:-10px;"><b>Email:</b> sales@manglamelectricals.com</p>
                            </td>
                            <td align="right">
                                <p style="padding-top:-2px;"></p>
                                <#if record.entity.custentity_in_gst_vendor_regist_type=='SEZ' || record.entity.custentity_in_gst_vendor_regist_type=='Overseas' && count=0><span class="title">Export Invoice</span>
                                    <#else><span class="title">Tax Invoice</span>
                                </#if>
                                <p font-size="10"><b>Invoice No:</b> ${record.tranid}</p>
                                <p font-size="10"><b>Date:</b> ${record.trandate}</p>
                            </td>
                        </tr>
                    </table>
                </macro>
                <macro id="nlfooter">
                    <table class="footer" style="width: 100%;">
                        <tr>
                            <td>
                                <barcode codetype="code128" showtext="true" value="${record.tranid}" />
                            </td>
                            <td align="right">
                                <pagenumber /> of
                                <totalpages />
                            </td>
                        </tr>
                    </table>
                    <p font-size="9" align="center">This is a Computer Generated Invoice</p>
                </macro>
            </macrolist>
            <style type="text/css">
            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
            }

            b {
                font-weight: bold;
                color: #333333;
            }

            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;
            }

            table.body td {
                padding-top: 2px;
            }

            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;
            }

            td.address {
                padding-top: 0px;
            }

            td.totalboxmid {
                font-size: 28pt;
                padding-top: 20px;
                background-color: #e3e3e3;
            }

            td.totalboxbot {
                background-color: #e3e3e3;
                font-weight: bold;
            }

            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;
            }

            .invoicebox {
                border: 1px;
                border-color: #000000;
                margin-top: 2px;
                width: 211px;
                padding-bottom: 0px;
                padding-top: 1px;
                min-height: 100px;
                max-height: 100px;
            }
            </style>
        </head>

        <body header="nlheader" header-height="20%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
            <#assign currency={"US Dollar":"$", "Euro" :"€", "British pound" :"£", "Indian Rupee" :"₹"}>
            <table align="left" width="100%" style="padding-left:-5px;margin-top:15px;">
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td><b>Delivery Note No. </b></td>
                                <td>:</td>
                                <td>${record.custbody1}</td>
                            </tr>
                            <tr>
                                <td><b>Delivery Note Date </b></td>
                                <td>:</td>
                                <td>${record.custbody2}</td>
                            </tr>
                            <tr>
                                <td><b>Due Date </b></td>
                                <td>:</td>
                                <td>${record.duedate}</td>
                            </tr>
                            <tr>
                                <td><b>Your Order Ref </b></td>
                                <td>:</td>
                                <td>${record.otherrefnum}</td>
                            </tr>
                            <tr>
                                <td><b>PO Date </b></td>
                                <td>:</td>
                                <td>${record.custbody3}</td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        <table>
                            <tr>
                                <td><b>Mode/Terms of Payment </b></td>
                                <td>:</td>
                                <td>${record.terms}</td>
                            </tr>
                            <tr>
                                <td><b>Dispatch Document No. </b></td>
                                <td>:</td>
                                <td>${record.custbody6}</td>
                            </tr>
                            <tr>
                                <td><b>Dispatched Through </b></td>
                                <td>:</td>
                                <td>${record.custbody_jj_dispatch_through}</td>
                            </tr>
                            <tr>
                                <td><b>Destination </b></td>
                                <td>:</td>
                                <td>${record.shipcity}</td>
                            </tr>
                            <tr>
                                <td><b>Term of Delivery </b></td>
                                <td>:</td>
                                <td>${record.custbody_str_delivery_terms}</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
          <table style="width: 100%; margin-top: 20px;">
                <tr>
                    <td class="addressheader" colspan="4"><b>${record.billaddress@label}</b></td>
                    <td class="addressheader" colspan="3"><b>${record.shipaddress@label}</b></td>
                    <td class="totalboxtop" colspan="6"><b>${record.total@label?upper_case}</b></td>
                </tr>
                <tr>
                     <td class="address" colspan="4" rowspan="2">${record.billaddress}
      </td>
                    <td class="address" colspan="3" rowspan="2">${record.shipaddress}</td>
                    <td align="right" class="totalboxmid" colspan="6">${currency[record.currency]} ${record.total}</td>
                </tr>
                <tr>
                </tr>
            </table>
              <p>
      <b>Email:</b> ${record.entity.email}
      </p>
      <p>
        <b>Phone:</b> ${record.entity.phone}
      </p>
            <table class="body" style="width: 100%; margin-top: 10px;">
                <tr>
                    <th>Place of Supply</th>
                    <th>${record.salesrep@label}</th>
                    <th>
                        <p align="right">${record.shipmethod@label}</p>
                    </th>
                </tr>
                <tr>
                    <td>${record.custpage_in_place_of_supply}</td>
                    <td>${record.salesrep}</td>
                    <td>
                        <p align="right">${record.custbody_jj_shipping_method}</p>
                    </td>
                </tr>
            </table>
            <#if record.item?has_content>
                <#assign index=0>
                    <table font-size="8" class="itemtable" style="width: 100%; margin-top: 10px;">
                        <!-- start items -->
                        <#list items.items as item>
                            <#if item_index==0>
                                <thead>
                                    <tr>
                                        <th colspan="4">SNo.</th>
                                        <th colspan="16">Item Code Description</th>
                                        <th colspan="8">
                                            <p align="left">HSN/SAC</p>
                                        </th>
                                        <th colspan="6">
                                            <p align="left">UOM</p>
                                        </th>
                                        <th align="center" colspan="5">Qty</th>
                                        <th align="right" colspan="12">Rate</th>
                                        <th align="right" colspan="12">Amount</th>
                                        <th align="right" colspan="8" style="padding: 10px 6px; white-space: nowrap;">Tax Rate</th>
                                        <th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">Tax Amount</th>
                                        <th align="right" colspan="12" style="padding: 10px 6px; white-space: nowrap;">Gross Amount</th>
                                    </tr>
                                </thead>
                            </#if>
                            <tr>
                                <td colspan="4">
                                    <#assign index=index+1>${index}
                                </td>
                                <td colspan="16" line-height="150%"><span class="itemname">${item.item}</span><br />${item.components}<br />${item.description}
                                </td>
                                <td colspan="8">${item.hsncode}</td>
                                <td colspan="6">${item.unit}</td>
                                <td align="center" colspan="5">${item.quantity}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.rate}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.amount}</td>
                                <td align="right" colspan="8">${item.taxrate}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.taxamount}</td>
                                <td align="right" colspan="12">${currency[record.currency]} ${item.grossamt}</td>
                            </tr>
                        </#list><!-- end items -->
                    </table>
                    <hr />
            </#if><!-- start Tax Summary -->
            <#if record.item?has_content>
                <table style="width: 100%; margin-top: 10px;">
                    <#list record.taxsummary as tax>
                        <#if tax_index==0>
                            <tr>
                                <th>${tax.taxtype@label}</th>
                                <th colspan="2">${tax.taxcode@label}</th>
                                <th>${tax.taxbasis@label}</th>
                                <th>${tax.taxrate@label}</th>
                                <th>${tax.taxamount@label}</th>
                            </tr>
                        </#if>
                        <tr>
                            <td>${tax.taxtype}</td>
                            <td colspan="2">${tax.taxcode}</td>
                            <td>${currency[record.currency]}${tax.taxbasis}</td>
                            <td>${tax.taxrate}</td>
                            <td>${currency[record.currency]} ${tax.taxamount}</td>
                        </tr>
                    </#list>
                </table>
              
            </#if>
              <#assign chargeAmt = 0>
  <#list record.item as item>
	<#if item.itemtype =='OthCharge' >
       <#assign chargeAmt = chargeAmt + item.amount>
      </#if>
    </#list>
 
              
              <table style="page-break-inside: avoid; width: 100%; margin-top: 10px;"><tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${record.subtotal@label}</td>
  <td align="right">${currency[record.currency]}${record.subtotal}</td>
  </tr>
 
  <#if record.taxtotal2?has_content >
   <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">IGST</td>
  <td align="right"><#if chargeAmt !=0 ><#assign subchargeAmt = record.subtotal - chargeAmt>${currency[record.currency]}${subchargeAmt?string["0.00"]}<#else>${currency[record.currency]}${record.subtotal}</#if>


</td>
    </tr></#if>
    
     <#list record.item as item>
   <#if item.itemtype =='OthCharge' >
       <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${item.item}</td>
  <td align="right">${item.amount}</td>
    </tr>
      </#if>
    </#list>


   <#if record.taxtotal5?has_content >
  <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">UTGST</td>
  <td align="right">${currency[record.currency]}${record.taxtotal5}</td>
     </tr></#if>
   <#if record.taxtotal3?has_content >
  <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">CGST</td>
  <td align="right">${currency[record.currency]}${record.taxtotal3}</td>
     </tr></#if>
 
    <tr>
  <td colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">Round Off</td>
      <td align="right"><#assign round = record.total?round ><#assign round = record.total - round >${currency[record.currency]} ${round?string["##0.00"]}</td>
  </tr>
  <tr style="background-color: #e3e3e3; line-height: 200%;">
  <td background-color="#ffffff" colspan="4"> </td>
  <td align="right" style="font-weight: bold; color: #333333;">${record.total@label}</td>
  <td align="right">${currency[record.currency]}${record.total}</td>
  </tr></table>
            <table width="100%">
                <tr>
                    <td align="left" colspan="2">
                        <p font-size="9">Amount (in words): <b>${record.custbody_amount_in_wrds}</b></p>
                        <p font-size="9">Company's PAN: <b> AAJPK0556E</b></p>
                        <#if record.entity.custentity_in_gst_vendor_regist_type=='SEZ' || record.entity.custentity_in_gst_vendor_regist_type=='Overseas'><br /><br /><br /><br />
                            <p>Declaration</p>
                            <p>1) Supply meant for SEZ unit/ SEZ Developers with the
                                payment of IGST</p>
                            <p>2) Supply meant for SEZ unit/SEZ Developers with filing of
                                LUT No.</p>
                            <p>3) Supply meant for Export with the payment of IGST</p>
                            <p>4) Supply meant for Export with filing of LUT No.</p>
                            <p>5) Supply meant for Export with filling of Bond </p>
                            <#else>
                                <br /><br /><br /><br /><br /><br /><br />
                                <p>Declaration</p>
                                <p>1) Received the above goods in perfect order & condition</p>
                                <p>2) Goods once sold will not be accepted back.</p>
                                <p>3) Interest@ 24% will be charged if not paid as per payment
                                    terms.</p>
                        </#if>
                    </td>
                    <td>
                        <table>
                            <tr>
                                <td align="left">
                                    <p font-size="10">Company's Bank Details</p>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table style="padding-left:-6px;">
                                        <tr>
                                            <td>
                                                <p>Bank Name</p>
                                            </td>
                                            <td>:</td>
                                            <td>${companyInformation.custrecord1}</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p>A/C No.</p>
                                            </td>
                                            <td>:</td><td>${companyInformation.custrecord2}</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <p>Bank & IFSC Code</p>
                                            </td>
                                            <td>:</td><td>${companyInformation.custrecord3} </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table style="margin-top:10px;" class="invoicebox">
                                                    <tr>
                                                        <td>
                                                            <p align="left">For Manglam Electricals</p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <p align="right"></p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <p align="right"></p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <p align="right">Authorised Signatory </p>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </body>
    </pdf>
</pdfset>

Suitelet

/**
 * @NApiVersion 2.x
 * @NScriptType Suitelet
 * @NModuleScope SameAccount
 */
/**
 * Script Description: PDF Creation 
 */
/*******************************************************************************
 * * ME * *
 * **************************************************************************
 * Date:13/3/19
 * Script name: ME JJ SL Print Invoice
 * Script id: customscript_jj_sl_print_invoice
 * 
 ******************************************************************************/
define(['N/file', 'N/render', 'N/record', 'N/search', 'N/config', 'N/file', 'N/encode'], function (file, render, record, search, config, file, encode) {
    /**
     * Definition of the Suitelet script trigger point.
     *
     * @param {Object} context
     * @param {ServerRequest} context.request - Encapsulation of the incoming request
     * @param {ServerResponse} context.response - Encapsulation of the Suitelet response
     * @Since 2015.2
     */
    function onRequest(context) {
        try {
            var internalId = context.request.parameters.intenalId;
            var objRecord = record.load({
                type: "invoice",
                id: internalId
            });
        
            var mainitem = objRecord.getValue({
                fieldId: 'custbody_jj_main_item_print',

            });

            var items = [];
            var length = objRecord.getLineCount({ sublistId: 'item' });
            //log.debug("line", length)
            var itemgroup_count = 0;
            for (var i = 0; i < length; i++) {
                var itemtype = objRecord.getSublistValue({
                    sublistId: 'item',
                    fieldId: 'itemtype',
                    line: i
                });


                if (itemtype == 'Group' && mainitem == false )
                    itemgroup_count++;
            }


            if (itemgroup_count > 0) {
                log.debug("integrated item")
                var myFile = render.create();

                var template = 140;
                myFile.setTemplateById(template);


                myFile.addRecord({
                    templateName: 'record',
                    record: objRecord
                });


                var quantity, amount, rate, grossamt, taxref, hsncode;
                for (var i = 0; i < length; i++) {
                    var itemtype = objRecord.getSublistValue({
                        sublistId: 'item',
                        fieldId: 'itemtype',
                        line: i
                    });
                    //log.debug("itemtype", itemtype + "i");

                    if (itemtype == 'Group') {
                        quantity = objRecord.getSublistValue({ sublistId: 'item', fieldId: 'quantity', line: i });
                        var component_items = [];
                        for (var j = i + 1; j < length; j++) {
                            var itemtype_new = objRecord.getSublistValue({
                                sublistId: 'item',
                                fieldId: 'itemtype',
                                line: j
                            });
                            if (itemtype_new == 'EndGroup') {
                                amount = objRecord.getSublistValue({ sublistId: 'item', fieldId: 'amount', line: j });
                                rate = parseFloat(amount / quantity).toFixed(2);
                                grossamt = objRecord.getSublistValue({ sublistId: 'item', fieldId: 'grossamt', line: j });

                                break;
                            } else if(itemtype != 'OthCharge'){

                                // get hsn code of component item
                                hsncode = objRecord.getSublistText({ sublistId: 'item', fieldId: 'custcol_in_hsn_code', line: j });

                                taxref = objRecord.getSublistValue({ sublistId: 'item', fieldId: 'taxdetailsreference', line: j });

                                var show_item = objRecord.getSublistValue({ sublistId: 'item', fieldId: 'custcol_jj_me71_show_item', line: j });
                                if (show_item != true)
                                    continue;
                                var is_substitute = objRecord.getSublistValue({ sublistId: 'item', fieldId: 'custcol_jj_substitute_item', line: j });
                                if (is_substitute == true)
                                    component_items.push(objRecord.getSublistValue({ sublistId: 'item', fieldId: 'custcol_jj_me102_substitute_item', line: j }));
                                else
                                    component_items.push(objRecord.getSublistText({ sublistId: 'item', fieldId: 'item', line: j }));
                            }
                        }
                        var component_arr = ' ';
                        for (var k = 0; k < component_items.length; k++) {
                            if (k == 0)
                                component_arr = component_items[k];

                            else
                                component_arr = component_arr + ',' + component_items[k];
                        }
                        //log.debug("component_arr", component_arr);
                        /*items.push({
                           components: component_arr});*/
                        if ((hsncode != '') && (hsncode != null) && (hsncode != undefined)) {
                            var lineNumber = objRecord.findSublistLineWithValue({
                                sublistId: 'taxdetails',
                                fieldId: 'taxdetailsreference',
                                value: taxref
                            });
                            log.debug("lineNumber", lineNumber)
                            var taxrate = objRecord.getSublistText({ sublistId: 'taxdetails', fieldId: 'taxrate', line: lineNumber });
                            var taxrate1 = objRecord.getSublistValue({ sublistId: 'taxdetails', fieldId: 'taxrate', line: lineNumber });
                            var taxamount = parseFloat((amount * taxrate1) / 100).toFixed(2);

                            var hsncode_arr = hsncode.split(" ");
                            //log.debug("hsncode_arr",hsncode_arr)
                            hsncode = hsncode_arr[0];
                        }

                        var is_substitute = objRecord.getSublistValue({ sublistId: 'item', fieldId: 'custcol_jj_substitute_item', line: i });
                                if (is_substitute == true){








                        items.push({
                            item: objRecord.getSublistText({ sublistId: 'item', fieldId: 'custcol_jj_me102_substitute_item', line: i }),
                            description: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'custcol_jj_me102_substitute_item_des', line: i }),
                            quantity: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'quantity', line: i }),
                            unit: 'each',
                            hsncode: hsncode,
                            taxrate: taxrate,
                            taxamount: taxamount,
                            rate: rate,
                            amount: amount,
                            grossamt: grossamt,
                            components: component_arr
                        });
                        log.debug("component_items", component_items);


                    }else{


                        items.push({
                            item: objRecord.getSublistText({ sublistId: 'item', fieldId: 'item', line: i }),
                            description: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'description', line: i }),
                            quantity: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'quantity', line: i }),
                            unit: 'each',
                            hsncode: hsncode,
                            taxrate: taxrate,
                            taxamount: taxamount,
                            rate: rate,
                            amount: amount,
                            grossamt: grossamt,
                            components: component_arr
                        });
                        log.debug("component_items", component_items);



                    }

                        i = j;

                    } else if (itemtype == 'EndGroup') {
                        continue;
                    } else if(itemtype != 'OthCharge'){
                        var hsncode = objRecord.getSublistText({ sublistId: 'item', fieldId: 'custcol_in_hsn_code', line: i });
                        var taxrate;
                        if ((hsncode != '') && (hsncode != null) && (hsncode != undefined)) {
                            var hsncode_arr = hsncode.split(" ");
                            //log.debug("hsncode_arr",hsncode_arr)
                            hsncode = hsncode_arr[0];
                            var taxref = objRecord.getSublistValue({ sublistId: 'item', fieldId: 'taxdetailsreference', line: i });
                            var lineNumber = objRecord.findSublistLineWithValue({
                                sublistId: 'taxdetails',
                                fieldId: 'taxdetailsreference',
                                value: taxref
                            });

                            taxrate = objRecord.getSublistText({ sublistId: 'taxdetails', fieldId: 'taxrate', line: lineNumber });
                        }
                        var is_substitute = objRecord.getSublistValue({ sublistId: 'item', fieldId: 'custcol_jj_substitute_item', line: i });
                        if (is_substitute == true){

                        items.push({
                            item: objRecord.getSublistText({ sublistId: 'item', fieldId: 'custcol_jj_me102_substitute_item', line: i }),
                            description: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'custcol_jj_me102_substitute_item_des', line: i }),
                            quantity: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'quantity', line: i }),
                            unit: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'units_display', line: i }),
                            hsncode: hsncode,
                            taxrate: taxrate,
                            taxamount: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'taxamount', line: i }),
                            grossamt: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'grossamt', line: i }),
                            rate: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'rate', line: i }),
                            amount: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'amount', line: i })
                        });

                    }else{


                        items.push({
                            item: objRecord.getSublistText({ sublistId: 'item', fieldId: 'item', line: i }),
                            description: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'description', line: i }),
                            quantity: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'quantity', line: i }),
                            unit: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'units_display', line: i }),
                            hsncode: hsncode,
                            taxrate: taxrate,
                            taxamount: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'taxamount', line: i }),
                            grossamt: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'grossamt', line: i }),
                            rate: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'rate', line: i }),
                            amount: objRecord.getSublistValue({ sublistId: 'item', fieldId: 'amount', line: i })
                        });





                    }









                    }

                }

                log.debug("items", items)



                myFile.addCustomDataSource({
                    format: render.DataSource.JSON,
                    alias: "items",
                    data: JSON.stringify({ items: items })
                });
                var invoicePdf = myFile.renderAsPdf();
                context.response.writeFile(invoicePdf, true);


            } else {
                log.debug("normal itm")
                var transactionFile = render.transaction({
                    entityId: Number(internalId),
                    printMode: render.PrintMode.PDF,
                    formId: 173,
                    inCustLocale: true
                });

                context.response.writeFile(transactionFile, true);



            }
        } catch (er) {
            log.debug('error', er)
        }
    }
    return {
        onRequest: onRequest
    };
});

User Event

/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @NModuleScope SameAccount
 */

/**
 * Script Description: This script is for setting E way bill button in Invoice
 */

/*******************************************************************************
 * * ME * *
 * **************************************************************************
 * Date:27/02/19 
 * Script name: ME JJ UE Print Invoie
 * Script id: customscript_jj_ue_print_invoice
 * Deployment id: 
 * Applied to: Invoice
 * 
 ******************************************************************************/

define(['N/search'],

    function(search) {

        /**
         * Function definition to be triggered before record is loaded.
         *
         * @param {Object} scriptContext
         * @param {Record} scriptContext.newRecord - New record
         * @param {string} scriptContext.type - Trigger type
         * @param {Form} scriptContext.form - Current form
         * @Since 2015.2
         */
        function beforeLoad(scriptContext) {
            try {


                var CustRec = scriptContext.form;
                if (scriptContext.type == 'view') {



                    //Loading Client Script
                    CustRec.clientScriptFileId = 966;

                    var recId = scriptContext.newRecord.id;

                    //Set button
                    var generate_eway = CustRec.addButton({
                        id: 'custpage_print_invoice',
                        label: 'Print Invoice',
                        functionName: 'printInvoice'
                    });


                }


            } catch (e) {

                log.debug({
                    title: e.name,
                    details: e.message
                });
            }

        }



        return {
            beforeLoad: beforeLoad
        };

    });

Client Script

/**
 * @NApiVersion 2.x
 * @NScriptType ClientScript
 * @NModuleScope SameAccount
 */
/**
 * Script Description: This script defining the function of button   
 */
/*******************************************************************************
 * * ME * *
 * **************************************************************************
 * Date:13/3/19
 * Script name: ME JJ CS Print Invoie
 * Script id: customscript_jj_cs_print_invoice
 * Deployment id: 
 * Applied to: Invoice
 * 

 ******************************************************************************/
define(['N/currentRecord', 'N/record', 'N/url', 'N/https'], function(currentRecord, record, url, https) {
    /**
     * Function to be executed after page is initialized.
     *
     * @param {Object} scriptContext
     * @param {Record} scriptContext.currentRecord - Current form record
     * @param {string} scriptContext.mode - The mode in which the record is being accessed (create, copy, or edit)
     *
     * @since 2015.2
     */
    function pageInit(scriptContext) {
        try {
            console.log("In");
        } catch (e) {
            console.log(e.name, e.message);
        }
    }

    function printInvoice() {
        try {
            var recID = currentRecord.get().id;
            console.log("recID", recID);
            var parameterObj = {
                intenalId: recID
            };
            var labelUrl = url.resolveScript({
                scriptId: "customscript_jj_sl_print_invoice",
                deploymentId: "customdeploy_jj_sl_print_invoice",
                returnExternalUrl: false,
                params: parameterObj
            });
            console.log("labelUrl", labelUrl);
            window.open(labelUrl)
        } catch (e) {
            console.log(e.name, e.message);
        }
    }
    return {
        pageInit: pageInit,
        printInvoice: printInvoice
    };
});

Leave a comment

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