Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-817

Require Inventory of Marketing Package Product can't be shipped

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 14.12.01, 12.04.06, 13.07.03, 16.11.01
    • Component/s: order
    • Labels:
      None
    • Environment:

      February 2007 svn

    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      Setting Require Inventory for a Marketing Product and (or ???) its Marketing Component causes the shiping system to fail. The shipping system reports nothing is ready to ship, ( [0 + 0 = 0] < 1 ).

      ---- exception report ----------------------------------------------------------
      [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this stack trace shows where this is happening:
      Exception: java.lang.Exception

      Message: Error in simple-method [Quick ships an entire order from multiple facilities [file:/wrk/ofbiz/ofbiz/applications/
      product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml#quickShipEntireOrder]]: ; [Warning: no shipments created;
      could not find anything ready and needing to be shipped.]

      ---- stack trace ---------------------------------------------------------------

      java.lang.Exception: Error in simple-method [Quick ships an entire order from multiple facilities [file:/wrk/ofbiz/ofbiz/
      applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml#quickShipEntireOrder]]: ; [Warning: no shipments
      created; could not find anything ready and needing to be shipped.]

      org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
      org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
      org.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:697)
      org.ofbiz.minilang.SimpleMethod.runSimpleMethod(SimpleMethod.java:105)
      org.ofbiz.minilang.SimpleMethod.runSimpleService(SimpleMethod.java:87)
      org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEngine.java:76)
      org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.java:51)
      org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:340)
      org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
      org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:113)
      org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:290)
      org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:409)

      1. OFBIZ-817.patch
        2 kB
        Ratnesh Upadhyay

        Activity

        Hide
        swash78 Swapnil Shah added a comment -

        As per further testing over trunk, it is found that setting requireInventory=Y over any marketing package type product means that for component products as well it would get honored even if its not set as Y for each or any of the components.

        In other words say,

        • The flag is as set as Y for a marketing package type product A and it has ATP/QOH=15/15
        • Product A has two component B & C as finished good and each having ATP/QOH = 8/8 and requireInventory is not set as Y for any of the components.
        • If sales order is attempted to be placed for A with ordered qty = 10 then system won't allow it to be placed because component B & C don't have sufficient ATP (irrespective of fact that none of them have requireInventory=Y)

        Expected behavior in above case should be to allow user to place the order for Product A as it has sufficient ATP=15 to fulfill the ordered qty=10. If the ordered qty happens to exceed 15 then only it should prevent ordering based on requireInventory=Y

        Show
        swash78 Swapnil Shah added a comment - As per further testing over trunk, it is found that setting requireInventory=Y over any marketing package type product means that for component products as well it would get honored even if its not set as Y for each or any of the components. In other words say, The flag is as set as Y for a marketing package type product A and it has ATP/QOH=15/15 Product A has two component B & C as finished good and each having ATP/QOH = 8/8 and requireInventory is not set as Y for any of the components. If sales order is attempted to be placed for A with ordered qty = 10 then system won't allow it to be placed because component B & C don't have sufficient ATP (irrespective of fact that none of them have requireInventory=Y) Expected behavior in above case should be to allow user to place the order for Product A as it has sufficient ATP=15 to fulfill the ordered qty=10. If the ordered qty happens to exceed 15 then only it should prevent ordering based on requireInventory=Y
        Hide
        upadhyay.ratnesh Ratnesh Upadhyay added a comment -

        Attaching patch to fix this issue. Patch is supplied from Ankush Upadhyay.

        Show
        upadhyay.ratnesh Ratnesh Upadhyay added a comment - Attaching patch to fix this issue. Patch is supplied from Ankush Upadhyay.
        Hide
        swash78 Swapnil Shah added a comment -

        Jacopo Cappellato Daniel Kunkel
        Ideally we shouldn't use the MARKETING_PKG product types as its a parent product type for product types MARKETING_PKG_AUTO, MARKETING_PKG_PICK. Thus we have changed the logic in "getMktgPackagesAvailable" service to handle product types MARKETING_PKG_AUTO, MARKETING_PKG_PICK to handle the reported issues more gracefully. Following are the changes we have done in the service vis-a-vis RequireInventory=Y setting for Package and/or its components. Now at the time of add to cart :

        1. if product type is MARKETING_PKG_AUTO then system will check it's own ATP instead of checking it's component ATP to allow or prevent placing order for package product..
        2. If product type is MARKETING_PKG_PICK then system will check it's component ATP to allow or prevent placing order for package product.

        Please find attached the patch for review that should address above mentioned fixes.

        Show
        swash78 Swapnil Shah added a comment - Jacopo Cappellato Daniel Kunkel Ideally we shouldn't use the MARKETING_PKG product types as its a parent product type for product types MARKETING_PKG_AUTO, MARKETING_PKG_PICK. Thus we have changed the logic in "getMktgPackagesAvailable" service to handle product types MARKETING_PKG_AUTO, MARKETING_PKG_PICK to handle the reported issues more gracefully. Following are the changes we have done in the service vis-a-vis RequireInventory=Y setting for Package and/or its components. Now at the time of add to cart : if product type is MARKETING_PKG_AUTO then system will check it's own ATP instead of checking it's component ATP to allow or prevent placing order for package product.. If product type is MARKETING_PKG_PICK then system will check it's component ATP to allow or prevent placing order for package product. Please find attached the patch for review that should address above mentioned fixes.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Hi Swapnil,

        I agree with you, since we can receive inventories of MARKETING_PKG_AUTO, without regard to their components availability, I see no reasons why we could not ship them.

        BTW I tried the same with MARKETING_PKG_PICK and it works as expected: you need to have the components at hand to ship them even if you tried to receive an inventory before. Since they need to be picked this makes sense.

        So this is a bug and I will commit and backport it

        Show
        jacques.le.roux Jacques Le Roux added a comment - Hi Swapnil, I agree with you, since we can receive inventories of MARKETING_PKG_AUTO, without regard to their components availability, I see no reasons why we could not ship them. BTW I tried the same with MARKETING_PKG_PICK and it works as expected: you need to have the components at hand to ship them even if you tried to receive an inventory before. Since they need to be picked this makes sense. So this is a bug and I will commit and backport it
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Ankush, Ratnesh and Swapnil

        Ankush your patch is in
        trunk 1714410
        R14.12 1714411
        R13.07 1714412
        R12.04 1714413

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Ankush, Ratnesh and Swapnil Ankush your patch is in trunk 1714410 R14.12 1714411 R13.07 1714412 R12.04 1714413

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            danielkunkel Daniel Kunkel
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Agile