Len, What is the reason to use the OrderItem.fromInventoryItemId field?
Actually I don't like the idea of that field in general, and even searching around the code am having trouble finding (and remembering...) what it is used for. In any case, it seems the be that what you really want to get to is the Facility to reserve in. Specifying the inventoryItemId desired is kind of funny if you only want the facilityId from it because having the inventoryItemId implies a lot more (like desire to reserve against that specific InventoryItem, or perhaps that a reservation should exist already for it or something). >From a use perspective are you saying that you want the user of the system to >select the Facility to fulfill from for each OrderItem in an order? If so, >let's talk about how to go about that more directly and not try to reuse >something meant for a different purpose. -David On Wed, 30 Jul 2008 09:41:10 -0400, "Len" <[EMAIL PROTECTED]> wrote: > > > All, > > > > I needed to create an order with many order items which are shipped from > one > or more facilities and for different shipment dates. In order to > accomplish > this I needed to make some configuration changes and some minor changes to > the existing Ofbiz framework. I am documenting the changes below. If > anyone sees any reason this should not work or have already solved this > matter differently please let me know. I am looking to eventually submit > these changes back to the trunk. > > > > > > > > Product Store Configuration. > > * On the product store edit screen: > * set the One Inventory Facility flag to 'N'. > * To associate your product store to many facilities you need to > execute the update button for each different facility you want associated. > Although the edit screen does not display the many facility associations > an > entry for each productStore-facility is written to the DB in > entity:ProductStoreFacility. > > > > Order Item Entry > > * On order creation the 'orderItem.fromInventoryId' of each order item > is populated with the inventory item id based on the product/inventory > item > selected. > * Create a ship group for each facility (related facility of the > inventory item), ship date combination. > > > > Order Services > > * Method: reserveInventory() > * In the reserve inventory method of this service each order item is > interrogated to see if the fromInventoryItemId was passed. If so the > related facility of the item is passed to the reserve Inventory service > specifying where availability and reservations should be done. > > > > Reserve Store Inventory > > * ProductStoreServices.xml > * Simple Method: reserveStoreInventory > * Modified the service parameters to accept an optional 'facilityId' > field. > * If a specific facilityId is passed in to this method: > > * Perform sanity check against the entity:ProductStoreFacility to > insure the facility has been associated to the product store (required > param > of the service). In other words does this Product Store ship products > from > this facility? > * Call Simple Method reserveProductInventoryByFacility. > > > > > > > > Test Data > > > > Product Store > > * Ofbiz E-Commerce Store (Product Store Id - 9000) > > * Inventory Facility Id - WebStoreWarehouse > * One Inventory Facility - N > * Check Inventory - Y > * Reserve Inventory - Y > * Is Immediately Fulfilled - N > > * Ofbiz Physical Retail Store (Product Store Id - 9100) > > * Inventory Facility Id - MyRetailStore > * One Inventory Facility - N > * Check Inventory - Y > * Reserve Inventory - Y > * Is Immediately Fulfilled - N > > > > Product Store Facility > > * Product Store Id - (9000) Facility Id - (WebStoreWarehouse) > * Product Store Id - (9000) Facility Id - (MyReatilStore) > > > > * Product Store Id - (9100) Facility Id - (MyRetailStore) > * Product Store Id - (9100) Facility Id - (WebStoreWarehouse) > > > > > > Order Items > > * Product Id - GZ-1001 > > * Inventory Item Id - 10080 (Facility Id - WebStoreWarehouse) > * Ship Date - 07/30/08 > > * Product Id - GZ-1000 > > * Inventory Item Id - 10079 (Facility Id - MyRetailStore) > * Ship Date - 07/29/08 > > * Two ship groups are created (0001,0002) > > > > Order > > * For accounting purposes the Order is created using the product store > Ofbiz E-Commerce Store (9000) > > > > Results > > * A single order was created > * Inventory was reserved for each product at it's respective facility > * After running pick and pack services separate packing slips, > shipments were generated for each ship group from their respective > facilities. > > > > > > Thank You > > > > Len Shein > > > > <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] > > > > Office: 516.742.7888 ext. 225 > > Office: 732.333.4303 > > > > > > >
