SalesOrder PDF

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

<!-- Configuration 
<#assign TESTING = false />
<#assign REMOVE_DOC_PREFIX = false />
<#assign SHIPPING_COST_LINE = false /> If true then print the shipping cost in the lines section. Otherwise include the shipping cost in the total section -->
<#assign DISPLAY_SOLINE_SHADDING = true /> 	<!-- Shade every 2nd item line -->

<!-- Note: To reference Sales Order fields in the invoice, use  record.createdfrom.saleseffectivedate -->


<#assign lineColour = "#1873C8" />
<#assign addressPaddingLeft = "0px" />
  

<!-- Macros -->
<!-- Print the transaction id. Strip any prefixs from the number if REMOVE_DOC_PREFIX = true -->
<#macro printDocNumber docName>
	<#if REMOVE_DOC_PREFIX>
      	${docName?replace("[^0-9]*","irf")}
    <#else>
       	${docName}
    </#if>
</#macro>

<!-- Print only the first word -->
<#macro printCode value >
 	 <#if value?index_of(" ") gt -1>
		 ${value[0..value?index_of(" ")]}
     <#else>
         ${value}
	 </#if>
 </#macro>


<!-- Stylesheets -->
<#if .locale == "ru_RU">
    <link name="verdana" type="font" subtype="opentype" src="${nsfont.verdana}" src-bold="${nsfont.verdana_bold}" bytes="2" />
</#if>
<style type="text/css">
	<#if TESTING>
      table, th, td {
        border: 1px dotted black;
 	 }
  	</#if>
    .TBC {
      font-weight: bold;
      color: red;
    }

      table {
        <#if .locale == "zh_CN">
            font-family: stsong, sans-serif;
        <#elseif .locale == "zh_TW">
            font-family: msung, sans-serif;
        <#elseif .locale == "ja_JP">
            font-family: heiseimin, sans-serif;
        <#elseif .locale == "ko_KR">
            font-family: hygothic, sans-serif;
        <#elseif .locale == "ru_RU">
            font-family: verdana;
        <#else>
        <!--    font-family: sans-serif; -->
          	font-family: sans-serif;
  		</#if>
        	color: black;
            font-size: 9pt;
            table-layout: fixed;
        }



  		<!-- Company Header -->
	  	.headerTable {
    		width:				100%;
         	height: 			220px;
  		}

  		.companyHeader {
          	font-weight: 		bold;
          	padding-top: 		0px;
        }
  		.companyDetail {
          	padding-top: 		0px;
        }


  		<!-- Document Header -->
		.docTable {
    		width:				100%;
          	margin-top:			0px;
  		}

  		.docType {
          	font-size: 			35pt;
          	font-family:		museosans500;
          	height:				40px;
        }
  		.docNumber {
          	font-size: 			16pt;
        }
    	.docdateHeader, .docdateDetail {
          	padding-top: 		5px;
          	padding-bottom: 	5px;
  			border-top:	 		1px solid black;
  			border-bottom: 		1px solid black;
        }
  		.docdateHeader {
 			border-left: 		1px solid black;
        }
  		.docdateDetail {
 			border-right: 		1px solid black;
        }


  		<!-- Document Detail Header -->
  		.referenceTable {
    		width:				100%;
  		}

  		.tagLine {
          	padding-top: 5px;
        }
  		.referenceAddress{
          	padding-top: 1px;
          	padding-bottom: 1px;
          	margin-top: 13px;
          	text-align : right;
          	padding-left:  		${addressPaddingLeft};

        }
  		.referenceHeader, .referenceDetail  {
           	font-size: 8pt;
          	padding-top: 0px;
        }
  		.referenceHeader {
          	font-weight: bold;
        }
		.referenceGST, .referencePage {
          	padding-top: 	5px;
        }
		.referencePage {
          padding-right: -20px;
        }
  		.referenceNewSection {
          margin-top: 5px;
        }


  		<!-- Address Details -->
  		.addressTable {
          	width:				100%;
          	padding:			0px;
          	margin:				0px;
        }
  		.addressBillingTable, .addressShippingTable {
          	width:				100%;
            height: 			120px;
            border: 			1px solid ${lineColour};
            margin-bottom: 		10px;
          	padding-left:		10px;
          	padding-top: 		8px;
        }
  		.addressHeader {
          	font-weight: 		bold;
          	height:				10px;
        }
  		.addressDetail {
           	height: 			80px;
          	padding-top: 		2px;
		}


  		<!--Details Header -->
  		.detailsTable {
         	width: 				100%;
         	margin-right:		2px;
         	margin-bottom: 		10px;
          	margin-left:		2px;
        }
  		.detailsHeader, .detailsHeaderEnd, .detailsHeaderGry {
          	border-left: 		1px solid ${lineColour};
          	border-top: 		1px solid ${lineColour};
          	font-weight: 		bold;
          	padding-bottom: 	1px;
          	padding-left: 		5px;
          	padding-top: 		5px;
        }
  		.detailsHeaderEnd {
       		border-right: 		1px solid ${lineColour};
        }
  		.detailsHeaderGry, .detailsHeaderBottomGry {
            background-color:	#efefef;
        }
    	.detailsHeaderBottom, .detailsHeaderBottomEnd, .detailsHeaderBottomGry {
         	border-left: 		1px solid ${lineColour};
          	border-bottom: 		1px solid ${lineColour};
          	padding-top: 		1px;
            padding-left: 		5px;
          	padding-bottom: 	5px;
        }
  		.detailsHeaderBottomEnd {
          	border-right: 		1px solid ${lineColour};
        }



		<!-- Notes/Special Instructions -->
		.noteTable {
          	width: 				100%;
          	margin-left:		2px;
			margin-bottom:		10px;
            border: 			1px solid ${lineColour};
        }
		.noteHeader {
          	font-weight:		bold;
        }
		.noteDetail {
          	font-weight:		bold;
			color:				red;
          	height: 			60px;
        }



 		<!--Items List -->
  		.itemTable {
          	width: 				100%;
          	height: 			610px;
          	margin-left:		2px;
        }
  		.itemHeader, .itemHeaderEnd, .itemHeaderTop, .itemHeaderBot, .itemHeaderTopEnd, .itemHeaderBotEnd {
 	      	padding-left: 		5px;
          	padding-right: 		5px;
          	padding-top:		1px;
            font-size: 			8pt;
          	font-weight: 		bold;
            vertical-align: 	middle;
            background-color:	${lineColour};
          	color:				black;
        }
  		.itemHeader, .itemHeaderEnd {
          	border-top: 		1px solid ${lineColour};
          	border-bottom: 		1px solid ${lineColour};
          	border-left: 		1px solid ${lineColour};
        }
        .itemHeaderEnd {
          	border-right: 		1px solid ${lineColour};
        }
  		.itemHeaderTop {
          	border-top: 		1px solid ${lineColour};
          	border-left: 		1px solid ${lineColour};
        }
  		.itemHeaderBot {
          	border-left: 		1px solid ${lineColour};
          	border-bottom: 		1px solid ${lineColour};
        }
    	.itemHeaderTopEnd {
          	border-top: 		1px solid ${lineColour};
          	border-left: 		1px solid ${lineColour};
            border-right: 		1px solid ${lineColour};
        }
  		.itemHeaderBotEnd {
          	border-left: 		1px solid ${lineColour};
          	border-bottom: 		1px solid ${lineColour};
            border-right: 		1px solid ${lineColour};
        }
		.itemDetail, .itemDetailCode, .itemDetailEnd, .itemDetailGry {
          	border-left: 		1px solid ${lineColour}; 
          	padding-top: 		5px;
          	padding-right:		5px;
            padding-bottom:		0px;
          	padding-left:		5px;
        }
  		.itemDetailCode {
            font-size: 			8pt;
          	vertical-align:		top;
        }
  		.itemDetailGry {
            background-color:	#efefef;
  		}
  		.itemDetailEnd {
          	border-right: 		1px solid ${lineColour};
        }

  		.rowItem {
          	height: 			36px;
          	padding:			0px;
        }
  		.rowItemBottom {
           	border-bottom: 		1px solid ${lineColour};
        }



  		<!-- Terms and Conditions. Bank Details -->
   		.footerTable {
      		height: 			140px;
        }
   		.footerTerms {
		    padding: 			0px;
          	margin: 			0px;
          	margin-right: 		-1px;
        }
   		.footerTotal {
          	padding-top: 		0px;
          	margin-top: 		0px;
          	padding-left: 		0px;
          	margin-left: 		0px;
        }



		<!-- Shipping and Terms -->
  		.termsTable {
          	width: 				100%;
          	padding:			2px;
          	margin-top:			0px;
          	margin-left:		0px;
            border-right:		1px solid ${lineColour};
            border-bottom:		1px solid ${lineColour};
            border-left:		1px solid ${lineColour};
        }
   		.termsHeader {
          	font-weight:		bold;
         }
   		.termsHeader, .termsDetail {
          	font-size: 			7pt;
          	padding-top: 		5px;
          	padding-bottom:		1px;
        }

  		.shipHeader, .shipHeaderEnd {
          	background-color: 	#d3d1d1; 
          	padding:			5px;
        }
		.shipDetail, .shipDetailEnd {
          	border-left: 		1px solid #d3d1d1;
          	border-bottom:	 	1px solid #d3d1d1;
            padding:			5px;
        }
  		.shipHeaderEnd, .shipDetailEnd {
          	border-right: 		1px solid #d3d1d1;
        }
    	.shipHeaderBottom, .shipHeaderBottomEnd {
          	border-left: 		1px solid #d3d1d1; 
          	border-bottom: 		1px solid #d3d1d1;
          	padding-top: 		2px;
        }
  		.shipHeaderBottomEnd {
          	border-right: 		1px solid #d3d1d1;
        }

  		<!-- Totals -->
  		.totalTable {
          	width: 				91.5%;
			margin-top:			0px;
          	margin-right:		-2px;
        }

  		.subtotalHeader, .shiptotalHeader, .gsttotalHeader, .totalHeader, .amountpaidHeader, .amountremainHeader {
           	padding-left: 		10px;
          	padding-right: 		10px;
          	padding-top: 		0px;
          	padding-bottom: 	0px;
           	font-weight: 		bold;
          	font-size:			10pt;
        }
		.amountpaidHeader, .amountremainHeader {
           	font-weight: 		normal;
        }
	  .subtotalDetail, .shiptotalDetail, .gsttotalDetail, .totalDetail, .amountpaidDetail, .amountremainDetail  {
            border-right:		1px solid ${lineColour};
            border-left:		1px solid ${lineColour};
           	padding-left: 		5px;
            padding-right:		5px;
          	padding-top: 		0px;
          	padding-bottom: 	0px;
    	}
  		.shiptotalDetail, .gsttotalDetail, .totalDetail, .amountremainDetail  {
            border-top: 		1px solid ${lineColour};
  		}
    	.subtotalDetail, .shiptotalDetail, .totalDetail {
            background-color:	#efefef;
  		}
  		.totalDetail, .amountremainDetail  {
            border-bottom:		1px solid ${lineColour};
  		}
</style>

<macrolist>
   <!-- Header -->
   <macro id="nlheader">
 	  <table>
	  <tr align="left" style="width:100px;">
        <td align="left" style="width:100px;font-size:28px;"><b>Sales Order</b></td>
		<!--<td align="left" style="font-size:30px; width:30px" ><b>Purchase Order</b></td>-->
        <td style="width:125px;"></td>
        <td style="width:125px;"></td>
        <td align="right" style="width:100px;">
          <img src="https://6797075.app.netsuite.com/core/media/media.nl?id=4280&amp;c=6797075&amp;h=L_80u_Zm_2PSnUxdVf-aZpoej5Aalb6IQmYmLI5Z7znEw9S2&amp;fcts=20211202070307&amp;whence="  align="right" style="width:269px;height:75px;"/>
        </td>
        </tr>
        <tr style="height:18px;"></tr>
     </table>
     
        <table align="right" style="width:259px">
       <tr align="right">
          <td align="left" style="width:25px;">${companyinformation.mainaddress_text}</td>
        </tr>
	  </table>    <!-- Address Details -->
	<table class="addressTable">
    <tr>
      	<td colspan="10" >
            <table class="addressBillingTable">
            <tr>
                <td><span class="addressHeader">Bill To:</span><br />
                    <span class="addressDetail">${record.billaddress}</span>
              </td>
            </tr>
            </table>
      	</td>
      	<td colspan="1">&nbsp;</td>
    	<td colspan="10">
            <table class="addressShippingTable">
            <tr>
                <td><span class="addressHeader">Deliver To:</span><br />
                    <span class="addressDetail">${record.shipaddress}</span>
                </td>
            </tr>
            </table>
         </td>
    </tr>
	</table>

    <!-- Document Details -->
	<table class="detailsTable" align="right">
    <tr>
      	<td colspan="6" class="detailsHeader"			align="left">Date</td>
      	<td colspan="6" class="detailsHeader"			align="left">Order No.</td>
		<td colspan="6" class="detailsHeader"			align="left">Ship Date</td>
      	<td colspan="6" class="detailsHeader"			align="left">Page</td>
      	<td colspan="6" class="detailsHeaderEnd"		align="left">SO No.</td>
    </tr>
	<tr>
    	<td colspan="6" class="detailsHeaderBottom"		align="left">${record.trandate}</td>
    	<td colspan="6" class="detailsHeaderBottom"		align="left">${record.otherrefnum}</td>
    	<td colspan="6" class="detailsHeaderBottom"		align="left">${record.shipdate}</td>
    	<td colspan="6" class="detailsHeaderBottom"		align="left"><pagenumber/> of <totalpages/></td>
    	<td colspan="6" class="detailsHeaderBottomEnd"	align="left"><@printDocNumber record.tranid /></td>
    </tr>
    </table>
	</macro>


</macrolist>
</head>


<body header="nlheader" header-height="320pt" footer="nlfooter" footer-height="5pt" padding="5mm 5mm 5mm 5mm" size="A4">




<table class="itemTable" width="100%">
  <thead>
    <tr>
      <th colspan="6"  class="itemHeader" 	 align="center" rowspan="2">Code</th>
      <th colspan="21" class="itemHeader"	 align="center" rowspan="2">Description</th>
      <th colspan="4"  class="itemHeaderTop" align="center"            >Quantity</th>
      <th colspan="4"  class="itemHeaderTop" align="center"            >Qty Back</th>
	  <th colspan="4"  class="itemHeader" align="center" rowspan="2">UOM</th>
      <th colspan="4"  class="itemHeader"	 align="center" rowspan="2">Rate</th>
      <th colspan="6"  class="itemHeaderEnd" align="center" rowspan="2">Line Total</th>
    </tr>
    <tr>
      <th colspan="4"  class="itemHeaderBot" align="center">Supplied</th>
      <th colspan="4"  class="itemHeaderBot" align="center">Ordered</th>
    </tr>
  </thead>


<!-- Print items -->
<#if record.item?has_content>


  <#assign lineNo = 0 />
  <#list record.item as item>
    <!-- Only print the description for non stock lines -->
    <#assign itemItem			= "" />
    <#assign itemDescription 	= item.description />
    <#assign itemQuantityOrd 	= "" />
    <#assign itemQuantityBO	 	= "" />
    <#assign itemQuantitySup	= "" />
    <#assign itemQuantity 		= "" />
    <#assign itemUOM	 	 	= "" />
    <#assign itemRate 			= "" />
    <#assign itemAmount			= "" />

    <#switch item.itemtype>
          <#case "Description"> 
          <#case "Group"> <!-- Item Group -->
            <#break> <!-- Only require the itemDescription field -->
          <#case "EndGroup">
          <#case "MarkUp">
          <#case "Discount">
            <#assign itemAmount			= item.amount?string("$#,##0.00") />
            <#break>
          <#case "Subtotal">
            <#assign itemDescription 	= "Subtotal" />
            <#assign itemAmount			= item.amount?string("$#,##0.00") />
            <#break>
          <#default>
            <#assign itemItem			= item.item />
            <#assign itemDescription 	= item.description />
            <#assign itemQuantityOrd 	= item.quantity />
            <#assign itemQuantityBO	 	= item.quantityremaining />
            <#assign itemUOM 	 		= item.units />
           	<#assign itemRate	 	 	= item.rate />
            <#assign itemAmount			= item.amount />
			<!-- Format numeric fields -->
            <#if itemRate?is_number>
              	<#assign itemRate	 	= itemRate?string("#,##0.00") />
            </#if>
            <#if itemAmount?is_number>
            	<#assign itemAmount		= itemAmount?string("$#,##0.00") />
            </#if>
        </#switch>

      <tr class="rowItem" <#if DISPLAY_SOLINE_SHADDING>style="background-color: ${((lineNo % 2)==0)?string('#ffffff', '#e0e0e0')};"</#if>>
        <td colspan="6"  class="itemDetailCode"	align="left"  ><@printCode itemItem /></td>
        <td colspan="21" class="itemDetail" 	align="left"  >${itemDescription}</td>
        <td colspan="4"  class="itemDetail" 	align="center">${itemQuantityOrd}</td>
        <td colspan="4"  class="itemDetail" 	align="center">${itemQuantityBO}</td>
        <td colspan="4"  class="itemDetail" 	 	align="left">${itemUOM}</td>
        <td colspan="4"  class="itemDetail" 	align="right" >${itemRate}</td>
        <td colspan="6"  class="itemDetailEnd" 	align="right" >${itemAmount}</td>
      </tr>
      <#assign lineNo = lineNo + 1 />
    </#list>
</#if>




<!-- This line is required to fill the remainder of the table -->
  <tr class="rowItemBottom">
    <td colspan="6"  class="itemDetail">&nbsp;</td>
    <td colspan="21" class="itemDetail">&nbsp;</td>
	<td colspan="4"  class="itemDetail">&nbsp;</td>
	<td colspan="4"  class="itemDetail">&nbsp;</td>
    <td colspan="4"  class="itemDetail">&nbsp;</td>
    <td colspan="4"  class="itemDetail">&nbsp;</td>
    <td colspan="6"  class="itemDetailEnd">&nbsp;</td>
  </tr>

<!-- Final Section -->
<tr class="footerTable">

     <!-- Shipping Details section -->
  	<td colspan="35" class="footerTerms">
        <table class="termsTable">
 		  <tr>
            <td colspan="20" class="termsHeader">Terms &amp; Conditions</td>
          </tr>
          <tr>
            <td colspan="20" class="termsDetail">
               
            </td>
        </tr>
      </table>
	</td>


     <!-- Total section -->
  	<td colspan="14" class="footerTotal" align="right">

        <!-- Shipping Cost -->
        <!-- If the shipping cost is printed at the line level then add the shipping cost to the subtotal -->
        <#assign subTotal = record.subtotal />
        <#if SHIPPING_COST_LINE && record.shippingcost?has_content && record.shippingcost != 0>
            <#assign subTotal = subTotal + record.shippingcost />
        </#if>

        <#assign paddingTotal = "padding-top: 5px; padding-bottom: 5px;" />
        <#if record.amountpaid?has_content && ((record.amountpaid+"") != "$0.00")>
       	   <#assign paddingTotal = "padding-top: 4px; padding-bottom: 4px;"  />
       </#if>
       <table class="totalTable">
          <tr>
              <td colspan="8" class="gsttotalHeader" style="${paddingTotal}" align="right">Subtotal</td>
              <td colspan="7" class="gsttotalDetail" style="${paddingTotal}" align="right">${subTotal?string("$#,##0.00")}</td>
          </tr>

         <!-- Shipping Cost in Total section-->
         <#if !SHIPPING_COST_LINE>
              <tr>
                  <td colspan="8" class="shiptotalHeader" style="${paddingTotal}" align="right">Delivery</td>
                  <td colspan="7" class="shiptotalDetail" style="${paddingTotal}" align="right"><#if record.shippingcost?has_content>${record.shippingcost?string("$#,##0.00")}</#if></td>
               </tr>
          </#if>

		  <!-- GST and Total -->
          <tr>
           	 <td colspan="8" class="gsttotalHeader" style="${paddingTotal}" align="right">GST</td>
           	 <td colspan="7" class="gsttotalDetail" style="${paddingTotal}" align="right">
               	<#if record.taxtotal?has_content>${record.taxtotal?string("$#,##0.00")}</#if></td>
          </tr>
          <tr>
           	 <td colspan="8" class="totalHeader" style="${paddingTotal}" align="right">Total</td>
           	 <td colspan="7" class="totalDetail" style="${paddingTotal}" align="right">${record.total?string("$#,##0.00")}</td>
          </tr>

          <!-- Deposit Payments -->
          <!--If customer has paid a deposit then show the final amount outstanding-->
          <#if record.amountpaid?has_content && ((record.amountpaid+"") != "$0.00")>
           <tr>
              <td colspan="8" class="amountpaidHeader" style="${paddingTotal}" align="right">${record.amountpaid@label}</td>
              <td colspan="7" class="amountpaidDetail" style="${paddingTotal}" align="right">${record.amountpaid?string("$#,##0.00")}</td>
            </tr>
            <tr>
              <td colspan="8" class="amountremainHeader" style="${paddingTotal}" align="right"><strong>${record.amountremaining@label}</strong></td>
              <td colspan="7" class="amountremainDetail" style="${paddingTotal}" align="right">${record.amountremaining?string("$#,##0.00")}</td>
            </tr>
          </#if>
          </table>
  	</td>
</tr>
</table>
         
</body>
</pdf>

Leave a comment

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