Scenario
The customer would like to show discount and shipping cost in the sales order pdf as inline. It should be shown even if the PDF is generated via print PDF icon or using Suitelet script.
The current PDF is as below.

Solution
- Ensure that following feature is enabled in the NetSuite account
Check this box to show discount and shipping items with descriptions as line-items in transaction columns. If you clear this box, the footer of the transaction shows only a shipping-item name and the total shipping and handling cost.

Now when you print the PDF using the standard print pdf button the PDF shows discount and shipping costs as inline.


Note the following if you are generating PDF via script
/**
*@NApiVersion 2.x
*@NScriptType Suitelet
*/
define(
[
'N/record',
'N/render',
'N/search'
]
, function (
record, render, search
)
{
function onRequest(context) {
var template = 126;
var salesorderid = context.request.parameters.salesorderid;
var renderer = render.create();
renderer.setTemplateById(template);
var soRecord = record.load({
type: record.Type.SALES_ORDER,
id: salesorderid
});
renderer.addRecord('record', soRecord);
log.debug('About to render');
var ifasString = renderer.renderAsString();
log.debug('rendered');
//log.debug('ifasString', ifasString);
context.response.renderPdf(ifasString);
}
return {
onRequest: onRequest
};
});
The above code prints the PDF using the template mentioned but it wont have the discount and shipping cost as we require. Instead we have to print the pdf as below
var formID_cominv = 173;
var salesorderid = context.request.parameters.salesorderid;
var cominvPDF = render.transaction({
entityId: Number(salesorderid),
formId: formID_cominv,
printMode: render.PrintMode.PDF
});
context.response.writeFile(cominvPDF, true);