You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Paul Foxworthy (JIRA)" <ji...@apache.org> on 2011/08/31 10:25:09 UTC

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

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


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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Paul Foxworthy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Foxworthy updated OFBIZ-4386:
----------------------------------

    Attachment: OFBIZ-4386_IssuanceServices.patch
                OFBIZ-4386_IssuanceTests.patch

> 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
>              Labels: issuance, order, shipment
>         Attachments: 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux reassigned OFBIZ-4386:
--------------------------------------

    Assignee: Jacques Le Roux

> 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_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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ 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

Hi Paul,

The test works perfectly. I have begun to review the code. I made some changes (mostly cosmetic) in IssuanceServices.xml:
* <set field="shipmentId" from-field="parameters.shipmentId"/> was duplicated in IssuanceServices.xml? Certainly due to a not updated revision when doing the patch (the patch applied after a fuzz factor)
* <log level="debug" message="qtyForShipmentItem: ${qtyForShipmentItem}"/> debug is not a valid level, I put warning
* I added short-description="Calculcate quantity for a shipment item - meant to be called in-line" to simple-method calcQtyForShipmentItemInline". It may be useful outside of the context (outside of the file I mean, like artifact info, etc.)
* I removed  <!--<call-simple-method method-name="findCreateIssueShipmentItem"/>-->

For now I attach the modified patch, to be continued...



> 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_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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Jacques Le Roux (Updated) (JIRA)" <ji...@apache.org>.
     [ 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

        

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

Posted by "Paul Foxworthy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Foxworthy updated OFBIZ-4386:
----------------------------------

    Attachment: OFBIZ-4386_IssuanceServices.patch

> 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_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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Paul Foxworthy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13102398#comment-13102398 ] 

Paul Foxworthy commented on OFBIZ-4386:
---------------------------------------

Thanks Jacques.

Fuzz would be due to my other recent submission OFBIZ-4344. I kept the patch for this issue independent of that.

Setting field shipmentId: There already is one in trunk at https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml?hb=true#to541
within the context of the issueInventoryItemToShipment simple method. I've added a second one in issueOrderItemShipGrpInvResToShipment. While the latter does call the former, issueInventoryItemToShipment is a service in its own right, so it can't assume a field has already been created, and must look in the parameters. So I think two occurrences are OK. Let me know if you see a problem with this.

Logging: Oops, sorry about that. I don't think it should be a warning - I'd suggest info instead. But I'm happy to stick with warning if you prefer that.

Delete commented out line: Yes, I agree. It was there in trunk, so I didn't touch it. In general, like you, I would rather simply delete obsolete code.


> 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_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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Paul Foxworthy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13107762#comment-13107762 ] 

Paul Foxworthy commented on OFBIZ-4386:
---------------------------------------

Hi Jacques, I've uploaded one more. Refreshed against trunk, fixed one typo, removed one line that was also in OFBIZ-4344.

> 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_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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Paul Foxworthy (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128834#comment-13128834 ] 

Paul Foxworthy commented on OFBIZ-4386:
---------------------------------------

Hi Jacques,

Thanks for persisting with this. Yes, all fine by me, please commit.

Cheers

Paul Foxworthy
                
> 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

        

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

Posted by "Jacques Le Roux (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-4386.
----------------------------------

       Resolution: Fixed
    Fix Version/s: SVN trunk
                   Release Branch 11.04
                   Release Branch 10.04

Thanks Paul,

Your patch is in
trunk r1185179
R11.04 r1185198
R10.04 r1185194
                
> 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
>             Fix For: Release Branch 10.04, Release Branch 11.04, SVN trunk
>
>         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

        

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

Posted by "Paul Foxworthy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13107748#comment-13107748 ] 

Paul Foxworthy commented on OFBIZ-4386:
---------------------------------------

Hi Jacques,

The same line was in the patch for OFBIZ-4344 committed in r1167517. I'll refresh the patch against the latest trunk and remove that line.

Cheers

Paul Foxworthy

> 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_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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13107758#comment-13107758 ] 

Jacques Le Roux commented on OFBIZ-4386:
----------------------------------------

Paul, it's already done in the last patch. I have just to review it again...

> 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_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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ 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,

About set field="shipmentId". What I mean is this (patch applied)
{code}
<!--<call-simple-method method-name="findCreateIssueShipmentItem"/>-->
<set field="eventDate" from-field="parameters.eventDate"/>
<set field="shipmentId" from-field="parameters.shipmentId"/>
<set field="shipmentId" from-field="parameters.shipmentId"/>
<call-simple-method method-name="findCreateItemIssuance"/>
<call-simple-method method-name="associateIssueRoles"/>
{code}

I have replaced warning by info for the log, more logical

> 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_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.
For more information on JIRA, see: http://www.atlassian.com/software/jira