You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Sharan Foga (JIRA)" <ji...@apache.org> on 2015/02/21 08:37:22 UTC

[jira] [Updated] (OFBIZ-4559) InventoryWorker.getOutstandingProductQuantities returns inaccurate results when there are multiple ItemIssuances for an order

     [ https://issues.apache.org/jira/browse/OFBIZ-4559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sharan Foga updated OFBIZ-4559:
-------------------------------
    Sprint: Bug Crush Event - 21/2/2015

> InventoryWorker.getOutstandingProductQuantities returns inaccurate results when there are multiple ItemIssuances for an order
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4559
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4559
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Release 10.04
>            Reporter: Skip Dever
>            Priority: Minor
>         Attachments: OFBIZ-4559.patch
>
>
> If you create a purchase order for say 50 of an item, and then receive part of that order, say 10, and then receive another 10.  If you then call InventoryWorker.getOutstandingProductQuantities(), the OrderItemQuantityReportGroupByItem.quantityOpen will report 80.  This is because there will be two ItemIssuance records, resulting in 2 * 50 OrderItem.quantity minus the 20 ItemIssuance.quantity in the result set of the query.
> I was able to verify this by creating a second view entity that can be viewed in WebTools
> Here is the added view entity (essentially removing the group-by="false" values:
>     <view-entity entity-name="OrderItemQuantityAndIssuance"
>             package-name="org.ofbiz.order.order"
>             never-cache="true"
>             title="Reports quantity ordered, issued and open by item for OrderItems.">
>       <member-entity entity-alias="OH" entity-name="OrderHeader"/>
>       <member-entity entity-alias="OI" entity-name="OrderItem"/>
>       <member-entity entity-alias="II" entity-name="ItemIssuance"/>
>       <alias entity-alias="OH" name="orderTypeId" group-by="true"/>
>       <alias entity-alias="OI" name="productId" group-by="true"/>
>       <alias entity-alias="OI" name="quantityOrdered" function="sum">
>           <complex-alias operator="-">
>               <complex-alias-field entity-alias="OI" field="quantity" default-value="0"/>
>               <complex-alias-field entity-alias="OI" field="cancelQuantity" default-value="0"/>
>           </complex-alias>
>       </alias>
>       <alias entity-alias="II" name="quantityIssued" field="quantity" function="sum"/>
>       <alias entity-alias="OI" name="quantityOpen" function="sum">
>           <complex-alias operator="-">
>               <complex-alias-field entity-alias="OI" field="quantity" default-value="0"/>
>               <complex-alias-field entity-alias="OI" field="cancelQuantity" default-value="0"/>
>               <complex-alias-field entity-alias="II" field="quantity" default-value="0"/>
>           </complex-alias>
>       </alias>
>       <view-link entity-alias="OI" rel-entity-alias="OH">
>         <key-map field-name="orderId"/>
>       </view-link>
>       <view-link entity-alias="OI" rel-entity-alias="II" rel-optional="true">
>         <key-map field-name="orderId"/>
>         <key-map field-name="orderItemSeqId"/>
>       </view-link>
>     </view-entity>
> If you use this entity and find a purchase order with multiple item issuances, the problem will be apparent.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)