Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Transaction Totals without tax?
Hi,
I'm trying to create a script that totals up all sales orders before taxes within this fiscal quarter. I can't seem to find the right search column to get the total without taxes. Here's a snippet of my code:
var statusFilter = new Array(); statusFilter[0] = 'SalesOrd:C'; var filters = new Array(); filters[0] = new nlobjSearchFilter('name', null, 'is', customerInternalID, null); filters[1] = new nlobjSearchFilter('trandate', null, 'within', 'thisfiscalquarter'); filters[2] = new nlobjSearchFilter('status', null, 'noneof', statusFilter, null); filters[3] = new nlobjSearchFilter('mainline', null, 'is', 'T'); var columns = new Array(); columns[0] = new nlobjSearchColumn('amount'); //calculate sales order total var salesOrderResults = nlapiSearchRecord('salesorder', null, filters, columns); //make a grand total if(salesOrderResults != null){ for (var i = 0; i < salesOrderResults.length; i++) { SOtotal = parseFloat(SOtotal) + parseFloat(salesOrderResults[i].getValue('amount')); } } alert("(debug) Sales: "+SOtotal); 0