You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (Updated) (JIRA)" <ji...@apache.org> on 2011/10/13 23:23:12 UTC

[jira] [Updated] (OFBIZ-4386) Order not completed when filled from more than one InventoryItem

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

Jacques Le Roux updated OFBIZ-4386:
-----------------------------------

    Attachment: OFBIZ-4386_IssuanceServices.patch

Paul,

I have reviewed your patch again.

I have changed
# <if-compare field="itemIssuance.inventoryItemId" operator="not-equals" value="inventoryItemId">
to
<if-compare-field field="itemIssuance.inventoryItemId" operator="not-equals" to-field="parameters.inventoryItemId">
there is no "inventoryItemId" value
# used "info" in all logs (as previously mentionned)
# removed trailing white spaces (not a big deal, I'm just used to)

This seems OK for with me now. Could you please double-check before I commit, thanks
                
> Order not completed when filled from more than one InventoryItem
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-4386
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4386
>             Project: OFBiz
>          Issue Type: Bug
>    Affects Versions: SVN trunk
>         Environment: rev 1163479
>            Reporter: Paul Foxworthy
>            Assignee: Jacques Le Roux
>              Labels: issuance, order, shipment
>         Attachments: OFBIZ-4386_IssuanceServices.patch, OFBIZ-4386_IssuanceServices.patch, OFBIZ-4386_IssuanceServices.patch, OFBIZ-4386_IssuanceServices.patch, OFBIZ-4386_IssuanceServices.patch, OFBIZ-4386_IssuanceTests.patch
>
>
> There is a nasty bug in IssuanceServices in the situation where the order is filled from more than one InventoryItem. When the order is created, there are OrderItemShipGrpInvRes reservations created for all the inventory items needed to fill the order.
> In the simple method issueOrderItemShipGrpInvResToShipment in IssuanceServices, at line 173 (https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml?hb=true#to173), there is an assumption that if the OrderShipment already exists, we are some sort of adjustment, and we should adjust the OrderShipment quantity by the difference between the old OrderShipment quantity and the new one. This all works fine in the situation where there is only one InventoryItem needed to fill the order. However, if there are two or more InventoryItems, the simple method is called twice, and an incorrect quantity is calculated.
> The crux of the problem is that OrderShipment doesn't care about InventoryItems, so there will be only one OrderShipment row for a given product. In contrast, ItemIssuance does care about InventoryItems, so there will be more than one if the product is supplied from more than one InventoryItem. The ItemIssuance code doesn't take account of this distinction.
> I have provided two patches. One is a new unit test that exemplifies the bug. If you just apply this patch to trunk, the unit test will fail with an OrderShipment quantity of 4 when it ought to be 6.
> The other patch is my fix for IssuanceServices, which now looks for a relevant ItemIssuance to decide if we are adjusting quantities, or creating a new ItemIssuance (and possibly a new OrderShipment).
> Feedback welcomed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira