【问题标题】:Is there a way of displaying backordered items on a Netsuite advanced PDF Packing Slip (freemarker)?有没有办法在 Netsuite 高级 PDF 装箱单 (freemarker) 上显示延期交货的商品?
【发布时间】:2019-12-09 00:03:23
【问题描述】:

基本上,我们有一个用于装箱单的 freemarker 表单(netsuite 称之为高级 PDF)。它显示已发货的商品,包括订购数量、发货数量和延期交货数量 - 很简单。 请记住,它需要尊重以前的发货,因此它不会显示已发货的商品。 问题是,在排除以前发货的过程中,它排除了尚未发货的延期交货商品,我们希望这些显示为 X 已订购,0 已发货,X 延期交货。

看看下面的部分 - 到目前为止,我已经尝试添加 #elseif 来表示quantitybackorder+quantitycommitted gt 0,但这实际上是按照订单上的行数重复履行的每一行,这很奇怪(即 8 行已订购,2 行已完成——这 2 行将重复 8 次,每组数据在其自己的行上)

<#if record.item?has_content>
            <table class="itemtable"><!-- start items -->
            <#list record.item as item>
                <#if item_index==0>
                    <thead>
                        <tr>
                            <th colspan="5" style="align: left;"><span style="font-size:12px;">Item Number</span></th>
                            <th colspan="12" style="align: left;"><span style="font-size:12px;">Item Description</span></th>
                            <th colspan="3"><span style="font-size:12px;">Ordered</span></th>
                            <th colspan="3"><span style="font-size:12px;">Backorder</span></th>
                            <th colspan="3"><span style="font-size:12px;">Shipped</span></th>
                            <th colspan="2"><span style="font-size:12px;">Unit</span></th>
                        </tr>
                    </thead>
                </#if>
                <#list salesorder.item as tranline>
                    <#if tranline.custcol_item_code==item.item>
                            <tr>
                                <td colspan="5"><p style="text-align: left;">${item.item}</p></td>
                                <td colspan="12"><p style="text-align: left;"><span style="font-weight: bold; line-height: 18px;">${item.description}</span><br /><em>${tranline.custcol_extra_details}</em></p></td>
                                <td colspan="3" style="align: center;">${tranline.quantity}</td>
                                <td colspan="3" style="align: center;">${tranline.quantitybackordered+tranline.quantitycommitted}</td>
                                <td colspan="3" style="align: center;">${item.quantity}</td>
                                <td colspan="2" style="align: center;">${tranline.units}</td>
                            </tr>
                    </#if>
                </#list>
            </#list>
    <!-- end items --></table>
</#if>

有谁知道我如何在这里允许延期交货的商品,或者换一种方式看待它,只排除已经履行的商品,留下当前的履行和延期交货? 非常感谢您的帮助!

【问题讨论】:

  • 你可以在这个答案的例子中看到如何做到这一点:stackoverflow.com/questions/56546879/…
  • @bknights 感谢您的回复-您所拥有的似乎是有道理的,并且经过一些调整,我希望它可以在我的情况下工作,但是经过调整或未调整,它会返回与 Jake Pearson 在您所指的错误中出现的错误相同。并在那里回答您的问题 - 是的,我们确实有一个脚本打印功能。
  • 它失败的行项目是否可能不是库存项目或无法履行?如果是这样(无论如何这是修复),您需要测试该值是否为数字。语法更改可能很简单 &lt;#assign prevShipped=tranline.quantityfulfilled?number&gt;

标签: if-statement netsuite freemarker


【解决方案1】:

我认为这是一个无法解决的问题,而您所拥有的可以解决它。我实际上已经远离了这一点,因为这对列表出于某种原因使所有行都加倍了。我最终得到的是:

<#list salesorder.item as tranline>
    <#list record.item as item>
        <#if tranline.custcol_item_code==item.custcol_item_code><#assign shippednow=item.quantity ><#else><#assign shippednow=0 ></#if>
    </#list>
    <tr>
        <td colspan="5"><p style="text-align: left;">${tranline.custcol_item_code}</p></td>
        <td colspan="12"><p style="text-align: left;"><span style="font-weight: bold; line-height: 18px;">${tranline.description}</span><br /><em>${tranline.custcol_extra_details}</em></p></td>
        <td colspan="3" style="align: center;"><#if tranline.quantity gt 0>${tranline.quantity}<#else>0</#if></td>
        <td colspan="3" style="align: center;">${tranline.quantitybackordered+tranline.quantitycommitted}</td>
        <td colspan="3" style="align: center;">${shippednow}</td>
        <td colspan="2" style="align: center;">${tranline.units}</td>
    </tr>
</#list>

【讨论】:

  • 我以为以上方法可以解决我的问题,只是有一个无法预料的问题 - 每张打印表格的第一行,无论有多少物品,都显示发货数量为 0。我看不到任何原因,但是有谁知道为什么那一行总是显示shipped = 0
  • 仍然找不到原因 - 有人有什么想法吗?
【解决方案2】:

除了我之前的回答之外,更好的方法是在开始之前将 shippingnow 定义为 0,然后绘制数据而不给它为零的选项。这样可以避免在第一行出现索引问题。

        <#list salesorder.item as tranline><#assign shippednow=0 >
          <#list record.item as item><#if item.orderline==tranline.line><#assign shippednow=item.quantity ></#if></#list><#assign prevship=tranline.quantityfulfilled-shippednow>
            <#if tranline.quantity==(prevship!0)><#else>
                    <tr>
                        <td colspan="5"><p style="text-align: left;">${tranline.custcol_item_code}</p></td>
                        <td colspan="12"><p style="text-align: left;"><span style="font-weight: bold; line-height: 18px;">${tranline.description}</span><br /><em>${tranline.custcol_extra_details}</em></p></td>
                        <td colspan="3" style="align: center;"><#if tranline.quantity gt 0>${tranline.quantity}<#else>0</#if></td>
                        <td colspan="3" style="align: center;">${(tranline.quantitybackordered+tranline.quantitycommitted)?string.number}</td>
                        <td colspan="3" style="align: center;">${shippednow!"0"}</td>
                        <td colspan="2" style="align: center;">${tranline.units}</td>
                      </tr></#if>
        </#list>

【讨论】:

    猜你喜欢
    • 2019-11-09
    • 2014-05-08
    • 2017-10-31
    • 2018-07-14
    • 2019-07-18
    • 2018-01-01
    • 1970-01-01
    • 2017-03-19
    • 2018-01-02
    相关资源
    最近更新 更多