lundi 31 octobre 2016

Netsuite Advanced PDF/HTML code item fulfilments

We have a template for item fulfilments that only works for the first 2 scenarios, (1 Complete & 2 partial);

1 Complete fulfilment for Sales Orders

  • 1st fulfilment (shows all SO items, shows all as shipped)

2 Partial fulfilments for Sales Orders

  • 1st fulfilment (shows all SO items, shows qty shipped + qty backorders)

  • 2nd/final fulfilment (shows remaining SO items, shows qty shipped)

3 (or more) Partial fulfilments for Sales Orders - PROBLEM SCENARIO

  • 1st fulfilment (shows all SO items, shows qty shipped + qty backorders)

  • 2nd fulfilment (shows all SO items, shows qty shipped + qty backorders)

  • etc. other partial shipments, same as above

  • Final fulfilment (shows remaining SO items, shows qty shipped)

Any order that has 3 or more partial shipments does not work. So, I want to completely re-write the list-item section of our fulfilments but I need some help with the code. This is the basic outline of what we need;

<#if record.item?has_content>

<#list record.item as item>
<#list salesorder.item as tranline>
<#if tranline.line==item.orderline>
<tr>
    <!-- item ID         --><td>${tranline.item}</td>
    <!-- U.O.M           --><td><#if tranline.units=="">Unit<#else>${tranline.units}</#if></td>
    <!-- Sales Order Qty --><td><#if tranline.quantityfulfilled==tranline.quantity>${item.quantity?c}<#else />${tranline.quantity?c}</#if></td>
    <!-- Fulfilled Qty   --><td>${item.quantity?c}</td>
    <!-- Backorder Qty   --><td><#if (tranline.quantity-tranline.quantityfulfilled)?int==0>&nbsp;<#else />${(tranline.quantity-item.quantity)?int}</#if></td>
    <!-- Column Spacing  --><td>&nbsp;</td>
    <!-- Item Description--><td>${item.description}</td>
</tr>

<!-- Items Unfulfilled/On Backorder -->
<!-- this is what I need help with -->
<!-- table layout set out similar to above -->
<!-- but including the header before list -->
<th>The following items are on Backorder:</th>
 <tr>
        <td><!-- item ID         --></td>
        <td><!-- U.O.M           --></td>
        <td><!-- Sales Order Qty --></td>
        <td><!-- column spacing  --></td>
        <td><!-- Backorder Qty   --></td>
        <td><!-- column spacing  --></td>
        <td><!-- Item Description--></td>
    </tr>

Aucun commentaire:

Enregistrer un commentaire