For the integrated item sales order PDF print out, if the item group is present in the item line it should show the component items of that group in comma separated format and the total amount and tax rate along with that.
Integrated Item Sales order PDF template
<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>
<link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
<#elseif .locale == "zh_TW">
<link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
<#elseif .locale == "ja_JP">
<link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
<#elseif .locale == "ko_KR">
<link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
<#elseif .locale == "th_TH">
<link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
</#if>
<macrolist>
<macro id="nlheader">
<table 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"><span class="title">${record@title}</span>
<p font-size="10"><b>Sales Order No:</b> ${record.tranid}</p> <p font-size="10"><b> Date:</b> ${record.trandate}</p></td></tr> </table>
</macro>
<macro id="nlfooter">
<table style="width: 100%; font-size: 8pt;"><tr>
<td style="padding: 0;"><barcode codetype="code128" showtext="true" value="${record.tranid}"/></td>
<td align="right" style="padding: 0;"><pagenumber/> of <totalpages/></td>
</tr></table>
</macro>
</macrolist>
<style type="text/css">* {
<#if .locale == "zh_CN">
font-family: NotoSans, NotoSansCJKsc, sans-serif;
<#elseif .locale == "zh_TW">
font-family: NotoSans, NotoSansCJKtc, sans-serif;
<#elseif .locale == "ja_JP">
font-family: NotoSans, NotoSansCJKjp, sans-serif;
<#elseif .locale == "ko_KR">
font-family: NotoSans, NotoSansCJKkr, sans-serif;
<#elseif .locale == "th_TH">
font-family: NotoSans, NotoSansThai, sans-serif;
<#else>
font-family: NotoSans, sans-serif;
</#if>
}
span.title {
font-size: 28pt;
}
.invoicebox
{
border:1px; border-color:#000000; margin-top:2px;width:211px;padding-bottom:0px;padding-top:1px;min-height:100px;max-height:100px;
}
table {
font-size: 9pt;
table-layout: fixed;
}
th {
font-weight: bold;
font-size: 8pt;
vertical-align: middle;
padding: 5px 6px 3px;
background-color: #e3e3e3;
color: #333333;
}
td {
padding: 4px 6px;
}
td p { align:left }
</style>
</head>
<body header="nlheader" header-height="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 style="width: 100%; margin-top: 10px;"><tr>
<td colspan="5" style="font-size: 8pt; font-weight: bold; color: #333333;padding-right:-5px;">${record.billaddress@label}</td>
<td colspan="3" style="font-size: 8pt; font-weight: bold; color: #333333;padding-right:-5px;">${record.shipaddress@label}</td>
<td colspan="6" style="font-size: 12pt; background-color: #e3e3e3; font-weight: bold;">${record.total@label?upper_case}</td>
</tr>
<tr>
<td class="address" colspan="5" rowspan="2">${record.billaddress}
<p style="font-size: 8pt;">
<b>Email:</b> ${record.entity.email}
</p>
<p style="font-size: 8pt;">
<b>Phone:</b> ${record.entity.phone}
</p>
</td>
<td colspan="3" style="padding-right:-5px;padding-top:-3px;">${record.shipaddress}</td>
<td align="right" colspan="6" style="font-size: 28pt; padding-top: 20px; background-color: #e3e3e3;">${record.total}</td>
</tr></table>
<table style="width: 100%; margin-top: 10px;"><tr>
<th colspan="4"><p align="left">Payment Terms</p></th>
<th colspan="8">${record.otherrefnum@label}</th>
<th colspan="6">PO Date</th>
<th colspan="8">Place of Supply</th>
<th colspan="6"><p align="center">${record.shipmethod@label}</p></th>
<th colspan="6">Due Delivery Date</th>
<th colspan="7">${record.salesrep@label}</th>
</tr>
<tr>
<td colspan="4" style="padding-top: 2px;">${record.terms}</td>
<td colspan="8" style="padding-top: 2px;">${record.otherrefnum}</td>
<td colspan="6" style="padding-top: 2px;">${record.custbody3}</td>
<td colspan="8" style="padding-top: 2px;">${record.custbody_in_place_of_supply}</td>
<td colspan="6" style="padding-top: 2px;"><p align="center" >${record.custbody_jj_shipping_method}</p></td>
<td colspan="6" style="padding-top: 2px;">${record.custbody_jj_due_delivery_date}</td>
<td colspan="7" style="padding-top: 2px;">${record.salesrep}</td>
</tr></table>
<#assign index = 0>
<#if record.item?has_content>
<table font-size="7" class="itemtable" style="width: 100%; margin-top: 10px;">
<!-- start items -->
<#list items.items as item>
<#if item_index==0 >
<thead>
<tr>
<th colspan="4">Sl.No.</th>
<th colspan="16"><p style="text-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">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%"><b>${item.item}</b><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 style="width: 100%; color: #d3d3d3; background-color: #d3d3d3; height: 1px;" /></#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 style="padding: 10px 6px;">${tax.taxtype@label}</th>
<th colspan="2" style="padding: 10px 6px;">${tax.taxcode@label}</th>
<th style="padding: 10px 6px;">${tax.taxbasis@label}</th>
<th style="padding: 10px 6px;">${tax.taxrate@label}</th>
<th style="padding: 10px 6px;">${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>
<hr style="width: 100%; color: #d3d3d3; background-color: #d3d3d3; height: 1px;" /></#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 gt 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">${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">${record.total}</td>
</tr></table>
<br/>
<table align="right" 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>
</body>
</pdf>
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: "salesorder",
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 = 137;
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: 168,
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
*/
/**
*
*/
/*******************************************************************************
* * ME * *
* **************************************************************************
* Date:01/03/19
*
* Author : Jobin and Jismi IT Services LLP
* Script Description: This script defines disabling buttons, adding buttons and on save actions in SO
* Script name: ME-71 JJ UE SO Actions
* Script id: customscript_me71_jj_ue_so_actions
* Deployment id: customdeploy_me71_jj_ue_so_actions
*
******************************************************************************/
define(['N/search','N/record'],
function(search,record) {
/**
* 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 {
if (scriptContext.type == 'view') {
var custRec=scriptContext.form;
var recId=scriptContext.newRecord.id;
log.debug({
title: 'recId',
details: recId
});
//Getting the SO fields
var soRecDtls = search.lookupFields({
type: record.Type.SALES_ORDER,
id: recId,
columns: ['customform']
});
var customForm=null;
if(soRecDtls.customform[0]!=null && soRecDtls.customform[0]!="" && soRecDtls.customform[0]!=undefined){
customForm=soRecDtls.customform[0].value;
}
custRec.clientScriptFileId = 969;
//If SO form is Integrated SO form
if(customForm==168){
//Set Delivery Challan button
custRec.addButton({
id:'custpage_so_send_to_assembler_btn',
label:'Delivery Challan',
functionName:'deliveryChellan'
});
//Set annexture Invoice button
/*custRec.addButton({
id:'custpage_so_send_to_annexture',
label:'Annexure',
functionName:'annexure'
});*/
//Set SO print button
custRec.addButton({
id:'custpage_salesorder_print',
label:'Print Sales Order',
functionName:'printSalesOrder'
});
}//Set Proforma Invoice button
custRec.addButton({
id:'custpage_so_send_to_assembler_btn',
label:'Proforma Invoice',
functionName:'proformaInvoice'
});
}
} catch (e) {
log.debug(e.name,e.message);
}
}
return {
beforeLoad: beforeLoad
};
});
Client
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
define(['N/currentRecord','N/url','N/https'],
function(currentRecord,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 deliveryChellan()
{
try{
var currentRec = currentRecord.get();
var id = currentRec.id;
console.log('id',id);
//Setting the url of the suitelet script
var output = url.resolveScript({
scriptId: 'customscript_me_82_jj_sl_delivery_chella',
deploymentId: 'customdeploy_me_82_jj_sl_delivery_chella',
returnExternalUrl: false,
}) + '&recId=' + id;
//Opens url on a new Window
newWindow = window.open(output);
}
catch (e) {
console.log(e.name, e.message);
}
}
function annexure()
{
try{
var currentRec = currentRecord.get();
var id = currentRec.id;
console.log('id',id);
//Setting the url of the suitelet script
var output = url.resolveScript({
scriptId: 'customscript_jj_me_117_sl_annexure',
deploymentId: 'customdeploy_jj_me_117_sl_annexure',
returnExternalUrl: false,
}) + '&recId=' + id;
//Opens url on a new Window
newWindow = window.open(output);
}
catch (e) {
console.log(e.name, e.message);
}
}
function proformaInvoice()
{console.log('inn');
try{
var recID = currentRecord.get().id;
console.log("recID", recID);
var parameterObj = {
intenalId: recID
};
//Setting the url of the suitelet script
var output = url.resolveScript({
scriptId: 'customscript_me_print_proforma_invoice',
deploymentId: 'customdeploy_me_print_proforma_invoice',
params: parameterObj
})
//Opens url on a new Window
newWindow = window.open(output);
}
catch (e) {
console.log(e.name, e.message);
}
}
function printSalesOrder()
{console.log('inn');
try{
var recID = currentRecord.get().id;
console.log("recID", recID);
var parameterObj = {
intenalId: recID
};
//Setting the url of the suitelet script
var output = url.resolveScript({
scriptId: 'customscript_me_printintegrateditem_so',
deploymentId: 'customdeploy_sl_printintegrateditem_so',
params: parameterObj
})
//Opens url on a new Window
newWindow = window.open(output);
}
catch (e) {
console.log(e.name, e.message);
}
}
return {
pageInit: pageInit,
deliveryChellan : deliveryChellan,
annexure:annexure,
proformaInvoice:proformaInvoice,
printSalesOrder:printSalesOrder
};
});