Is there any difference between "Remaining" and "Outstanding" in orderitems.ftl?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there any difference between "Remaining" and "Outstanding" in orderitems.ftl?

${uiLabelMap.OrderRemaining}       
       

Then immediately after that

                 
The only difference I can see between the Remaining and Outstanding numbers is the extra test the second time to force outstanding number to zero for a status of ITEM_COMPLETED. As the comment says, some goods won't need a shipment. In that case, it seems confusing and ridiculous to say some items are "remaining" but none are "outstanding". In other words, the calculation for outstanding is slightly better.

I see no reason to show both "Remaining" and "Outstanding". They seem logically equivalent. Am I missing something? Or should we remove one of the two?

Cheers

Paul Foxworthy  
--
Coherent Software Australia Pty Ltd
http://www.coherentsoftware.com.au/

Bonsai ERP, the all-inclusive ERP system
http://www.bonsaierp.com.au/
Paul Foxworthy
In trunk in applications/order/webapp/ordermgr/order/orderitems.ftl, have a look at lines 224 to 290

(see https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl?hb=true#to224)

Lines 224 to 238 establish values for the variables shippedQuantity and totalReceived

<#assign shippedQuantity = orderReadHelper.getItemShippedQuantity(orderItem)>
<#assign shipmentReceipts = delegator.findByAnd("ShipmentReceipt", {"orderId" : orderHeader.getString("orderId"), "orderItemSeqId" : orderItem.orderItemSeqId}, null, false)/>
<#assign totalReceived = 0.0>
<#if shipmentReceipts?exists && shipmentReceipts?has_content>
    <#list shipmentReceipts as shipmentReceipt>
    <#if shipmentReceipt.quantityAccepted?exists && shipmentReceipt.quantityAccepted?has_content>
         <#assign  quantityAccepted = shipmentReceipt.quantityAccepted>
         <#assign totalReceived = quantityAccepted + totalReceived>
     </#if>
     <#if shipmentReceipt.quantityRejected?exists && shipmentReceipt.quantityRejected?has_content>
          <#assign  quantityRejected = shipmentReceipt.quantityRejected>
          <#assign totalReceived = quantityRejected + totalReceived>
      </#if>
   </#list>
</#if>

Then they are used to calculate a value for remainingQuantity. The calculation is different for sales and purchase orders.

<#if orderHeader.orderTypeId == "PURCHASE_ORDER">
    <#assign remainingQuantity = ((orderItem.quantity?default(0) - orderItem.cancelQuantity?default(0)) - totalReceived?double)>
<#else>
     <#assign remainingQuantity = ((orderItem.quantity?default(0) - orderItem.cancelQuantity?default(0)) - shippedQuantity?double)>
</#if>

After a couple of rows in the table, we have this on lines 272 to 277
${remainingQuantity}${uiLabelMap.OrderQtyShipped}${shippedQuantity}
${uiLabelMap.OrderShortfalled}${shortfalledQuantity}${uiLabelMap.OrderOutstanding}         <#-- Make sure digital goods without shipments don't always remain "outstanding": if item is completed, it must have no outstanding quantity.  -->
         <#if (orderItem.statusId?has_content) && (orderItem.statusId == "ITEM_COMPLETED")>
                                                           0
         <#elseif orderHeader.orderTypeId == "PURCHASE_ORDER">
              ${(orderItem.quantity?default(0) - orderItem.cancelQuantity?default(0)) - totalReceived?double}
         <#elseif orderHeader.orderTypeId == "SALES_ORDER">
              ${(orderItem.quantity?default(0) - orderItem.cancelQuantity?default(0)) - shippedQuantity?double}
          </#if>
     
Reply | Threaded
Open this post in threaded view
|

Re: Is there any difference between "Remaining" and "Outstanding" in orderitems.ftl?

Jacques Le Roux
Administrator
Hi Paul,

Seems nobody never answered and the situation has not changed.

I suggest to create a Jira where it will be easier to read, exchange and focus.

Thanks

Jacques

Le 11/10/2012 à 08:35, Paul Foxworthy a écrit :

> In trunk in applications/order/webapp/ordermgr/order/orderitems.ftl, have a
> look at lines 224 to 290
>
> (see
> https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl?hb=true#to224)
>
> Lines 224 to 238 establish values for the variables shippedQuantity and
> totalReceived
>
> <#assign shippedQuantity =
> orderReadHelper.getItemShippedQuantity(orderItem)>
> <#assign shipmentReceipts = delegator.findByAnd("ShipmentReceipt",
> {"orderId" : orderHeader.getString("orderId"), "orderItemSeqId" :
> orderItem.orderItemSeqId}, null, false)/>
> <#assign totalReceived = 0.0>
> <#if shipmentReceipts?exists && shipmentReceipts?has_content>
>      <#list shipmentReceipts as shipmentReceipt>
>      <#if shipmentReceipt.quantityAccepted?exists &&
> shipmentReceipt.quantityAccepted?has_content>
>           <#assign  quantityAccepted = shipmentReceipt.quantityAccepted>
>           <#assign totalReceived = quantityAccepted + totalReceived>
>       </#if>
>       <#if shipmentReceipt.quantityRejected?exists &&
> shipmentReceipt.quantityRejected?has_content>
>            <#assign  quantityRejected = shipmentReceipt.quantityRejected>
>            <#assign totalReceived = quantityRejected + totalReceived>
>        </#if>
>     </#list>
> </#if>
>
> Then they are used to calculate a value for remainingQuantity. The
> calculation is different for sales and purchase orders.
>
> <#if orderHeader.orderTypeId == "PURCHASE_ORDER">
>      <#assign remainingQuantity = ((orderItem.quantity?default(0) -
> orderItem.cancelQuantity?default(0)) - totalReceived?double)>
> <#else>
>       <#assign remainingQuantity = ((orderItem.quantity?default(0) -
> orderItem.cancelQuantity?default(0)) - shippedQuantity?double)>
> </#if>
>
> After a couple of rows in the table, we have this on lines 272 to 277
> *${uiLabelMap.OrderRemaining}*
>       ${remainingQuantity}
>       *${uiLabelMap.OrderQtyShipped}*
>       ${shippedQuantity}
>  
>  
> Then immediately after that
>
>
>       *${uiLabelMap.OrderShortfalled}*
>       ${shortfalledQuantity}
>       *${uiLabelMap.OrderOutstanding}*
>      
>           <#-- Make sure digital goods without shipments don't always remain
> "outstanding": if item is completed, it must have no outstanding quantity.
> -->
>           <#if (orderItem.statusId?has_content) && (orderItem.statusId ==
> "ITEM_COMPLETED")>
>                                                             0
>           <#elseif orderHeader.orderTypeId == "PURCHASE_ORDER">
>                ${(orderItem.quantity?default(0) -
> orderItem.cancelQuantity?default(0)) - totalReceived?double}
>           <#elseif orderHeader.orderTypeId == "SALES_ORDER">
>                ${(orderItem.quantity?default(0) -
> orderItem.cancelQuantity?default(0)) - shippedQuantity?double}
>            </#if>
>      
>  
>
> The only difference I can see between the Remaining and Outstanding numbers
> is the extra test the second time to force outstanding number to zero for a
> status of ITEM_COMPLETED. As the comment says, some goods won't need a
> shipment. In that case, it seems confusing and ridiculous to say some items
> are "remaining" but none are "outstanding". In other words, the calculation
> for outstanding is slightly better.
>
> I see no reason to show both "Remaining" and "Outstanding". They seem
> logically equivalent. Am I missing something? Or should we remove one of the
> two?
>
> Cheers
>
> Paul Foxworthy
>
>
>
> -----
> --
> Coherent Software Australia Pty Ltd
> http://www.cohsoft.com.au/
>
> Bonsai ERP, the all-inclusive ERP system
> http://www.bonsaierp.com.au/
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Is-there-any-difference-between-Remaining-and-Outstanding-in-orderitems-ftl-tp4636846.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.