问题
I'm working on creating an Advanced PDF Packing List in Netsuite. I have tried following the record browser (https://4779356.app.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2018_2/script/record/salesorder.html) but only a few of the field id's for different quantities actually display data.
I've tried: ${tranline.quantity}
${tranline.quantityavailable}
${tranline.quantitybackordered}
${tranline.quantitybilled} ``${tranline.quantitycommitted}
${tranline.quantityfulfilled}
${tranline.quantityrevcommitted}
${record.item.quantity}
${record.item.quantityremaining}
and only tranline.quantity
returns any data, but it returns what was shipped out.
I expect to find the quantityordered
, quantityfulfilled
, and quantitybackordered
, but I am only able to get the tranline.quantity
, which displays the quantity that was shipped, which should be quantityfulfilled
.
回答1:
If you are starting with the standard packing slip from an Advanced PDF/HTML template then the records are available as record
for the item fulfillment and salesorder
for the originating Sales Order.
Whether or not you can access quantityfulfilled etc depends on what options you have turned on for your Netsuite account. If you can see quantity back ordered on the Sales Order then you probably have the right things turned on.
In order to coordinate the sales order lines with the fulfillment lines I use code like the sample below. Note this requires that the item fulfillment is not yet shipped.
<#list salesorder.item as tranline>
<#assign shipped=0>
<#assign prevShipped=tranline.quantityfulfilled>
<#assign qtyRemaining=tranline.quantity - prevShipped>
<#if (tranline.quantitybackordered gt 0)> <#assign qtyRemaining=tranline.quantitybackordered></#if>
<#list record.item as item><#if tranline.line==item.orderline>
<#assign shipped=item.quantity>
<#assign prevShipped=tranline.quantityfulfilled-item.quantity>
</#if></#list>
<tr>
<td colspan="12"><span class="itemname">${tranline.item}</span><#if tranline.itemtype =='NonInvtPart'>**<#assign anyNonInvt='T'></#if><br />${tranline.description?html}</td>
<td align="center" colspan="3"><#if shipped gt 0><b>${shipped}</b><#else>0</#if></td>
<td align="center" colspan="3">${tranline.quantity}</td>
<td align="center" colspan="3">${prevShipped}</td>
<td align="center" colspan="3">${qtyRemaining}</td>
<td colspan="4">${tranline.options?html}</td>
</tr>
</#list>
</#if>
来源:https://stackoverflow.com/questions/56546879/netsuite-field-ids-not-printing-on-advanced-pdf