简短版本:在使用 BFO 和 Freemarker 的 Netsuite Advanced PDF 中,我如何将行项目重复 x 次,其中 x 是项目数量?
代码:
<#if record.item?has_content>
<table class="itemtable" style="width: 100%; margin-top: 10px;
height:96mm;"><!-- start items --><#list record.item as item>
<tr>
<td>
<table style="width: 100%; height:100%;">
<tr>
<td width="70%"><#if item.custcol_upccode?length != 0><barcode bar-width="2" codetype="UPCA" showtext="true" height="50" value="${item.custcol_upccode}"/></#if></td>
<td width="30%" align="right" valign="bottom"><span style="font-weight:bold; vertical-align:bottom;">${item.custcol_item_collection}</span></td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td><p style="font-size:14pt; line-height:140%; padding:0 12pt 0 12pt;">${item.custcol_displayname}</p></td>
<td align="right" valign="middle"><span style="font-size:16pt; line-height:140%; font-weight:bold;"><#if record.custbody_container_id?has_content>${record.custbody_container_id}<#else>${record.tranid}</#if></span></td>
</tr>
<tr>
<td align="center" style="text-align:center !important;"><#if item.custcol_moq!=0 && item.custcol_moq!=1><div style="text-align:center !important; width:100%; height:100%; background-color:#000; padding:0 12pt 0 12pt;"><span style="color:#FFF; text-align:center !important; font-weight:bold;">${item.custcol_moq} PER BOX</span></div></#if></td>
<td align="right"><span style="font-size:14pt; line-height:140%; font-weight:bold;">
<#setting date_format="yyMM">
<#setting locale="en_US">
${record.custbody_etd}
</span></td>
</tr>
<tr>
<td colspan="2"><#if item.item?length != 0><barcode bar-width="1" codetype="code128" showtext="false" height="70" value="${item.item}"/></#if></td>
</tr>
<tr>
<td colspan="2"><span style="font-size:20pt; line-height:140%; font-weight:bold; padding:0 12pt 0 12pt;">${item.item}</span></td>
</tr>
</table>
</td>
</tr>
</#list><!-- end items -->
</table>
</#if>
长版本:我想要完成的是 - 我正在制作用于接收采购订单的商品标签。Netsuite 中的标签记录非常有限,不会让我提取这些以外的其他项目记录详细信息
因此,我的工作是创建一个单独的采购订单交易表格,指向一个包含上述代码的新采购订单高级 pdf,并将其限制为 6" x 4" 的主体以进行热敏标签打印。每个行项目成为一个单独的表格和一个新标签。
包含这 3 个项目的采购订单
创建这些标签
问题:
- 为什么它只返回 3 个项目中的 2 个?
- 以及如何拆分每个行项目以重复 x 次,其中 x 是 item.quantity?
在此示例中,第一个标签应重复 75 次,第二个标签应重复 65 次,第三个标签应显示并重复 60 次。最终目标是能够在 pdf 上按 print 并让它为收到的每个项目生成一个标签。