You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Joe Eckard (JIRA)" <ji...@apache.org> on 2014/11/09 00:26:33 UTC

[jira] [Commented] (OFBIZ-5370) OrderItemShipGrpInvRes incorrect when receiving an inventory item that relates to more than one record

    [ https://issues.apache.org/jira/browse/OFBIZ-5370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14203680#comment-14203680 ] 

Joe Eckard commented on OFBIZ-5370:
-----------------------------------

Is this the right approach to fixing the underlying issue? It seems like the “reassignInventoryItems” service will cancel and re-reserve ALL reservations for a specified product - which does avoid the reported problem, but can perform lots of unnecessary work and create many unnecessary artifacts (since it is called every time you receive inventory or perform a physical inventory / variance).

I ask only because I encountered this bug in an older codebase through a different set of circumstances, and trying to understand balanceInventoryItems has been a very confusing experience. I would love to see it cleaned up, removed or replaced.

My initial impression is that balanceInventoryItems was intended to be called whenever some inventory was added in order to immediately relieve as many backorders as it could. If that is the case, why not look for reservations with quantityNotAvailable > 0 instead of the current logic? If that approach is sound, there is still the case where balanceInventoryItems is called as an ECA when you perform a physical inventory and record a negative variance instead of a positive variance, but I think reassignInventoryItems might be the right thing to use there.

> OrderItemShipGrpInvRes incorrect when receiving an inventory item that relates to more than one record
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-5370
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5370
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Release Branch 12.04
>            Reporter: Christian Carlow
>            Assignee: Anil K Patel
>         Attachments: OFBIZ-5370-trunk.patch
>
>
> OrderItemShipGrpInv records that share the same inventoryItemId calculate incorrect results when receiving inventory for the product.
> To reproduce:
> 1.  Create an order for product "PEPPERS-G" with a quantity of 10 and click "Finish Order"
> 2.  Add another ship group and click "Continue"
> 3.  Assign 5 of the order items to the second ship group created and then finish the order
> 4.  Navigate to the Receive Inventory page of the WebStoreWarehouse facility
> 5.  Enter "PEPPERS-G" into the productId field and click "Receive Product"
> 6.  Enter a quantity of 6 into the quantityAccepted field and click "Receive"
> 7.  Open the OrderItemShipGrpInvRes table and notice that the quantityNotAvailable field has been set to blank for the first record and 4 for the second record and that they both share the same inventoryItemId
> 8.  Now navigate back to the Receive Items page and receive in the product again but with a quantity of 1
> 9.  Refresh the OrderItemShipGrpInvRes results and notice that the first record has a new inventory item applied to it with a quantity of 1 and the other record has been updated to reflect a new quantityNotAvailable value.
> It seems like OrderItemShipGrpInvRes should be deleted anytime the quantityNotAvailable field gets set to 0, blank, or null.  I've noticed this logic performed in other methods that deal the entity.
> Step 9 should not add quantityNotAvailable back to the first record one it has been fulfilled.  The second item was supposed to have its quantityNotAvailable field decremented by 1 but no change took plce for it. 
> I believe this problem is probably caused by an inventoryItemId being associated with more than one record in the table.
> This problem basically happens anytime the inventory received is greater than the quantityNotAvailable field of the first OrderItemShipGrpRes table.  It happens when you have orders from two different customers and you receive more inventory than the quantityNotAvailable for the first customer order item.



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