Author: jonesde
Date: Fri Jul 20 02:33:09 2007 New Revision: 557939 URL: http://svn.apache.org/viewvc?view=rev&rev=557939 Log: Added effectiveDate field to InventoryItemDetail to more easily find when an inventory change is effective; not really sofisticated for now, either current date/time or if there is an ItemIssuance then the issuanceDateTime Modified: ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml ofbiz/trunk/applications/product/entitydef/entitymodel.xml ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml ofbiz/trunk/applications/product/servicedef/services_facility.xml Modified: ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml?view=diff&rev=557939&r1=557938&r2=557939 ============================================================================== --- ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml (original) +++ ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml Fri Jul 20 02:33:09 2007 @@ -476,43 +476,43 @@ <!-- some default invnetory quantities, things are a bit underutilized without these... --> <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL01" inventoryItemId="9000" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-2644" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9000" inventoryItemDetailSeqId="0001" availableToPromiseDiff="500" quantityOnHandDiff="500"/> + <InventoryItemDetail inventoryItemId="9000" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="500" quantityOnHandDiff="500"/> <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL01" inventoryItemId="9001" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-2644" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9001" inventoryItemDetailSeqId="0001" availableToPromiseDiff="5" quantityOnHandDiff="5"/> + <InventoryItemDetail inventoryItemId="9001" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="5" quantityOnHandDiff="5"/> <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL02" inventoryItemId="9002" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-8544" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9002" inventoryItemDetailSeqId="0001" availableToPromiseDiff="15" quantityOnHandDiff="15"/> + <InventoryItemDetail inventoryItemId="9002" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="15" quantityOnHandDiff="15"/> <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL02" inventoryItemId="9003" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-8544" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9003" inventoryItemDetailSeqId="0001" availableToPromiseDiff="3" quantityOnHandDiff="3"/> + <InventoryItemDetail inventoryItemId="9003" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="3" quantityOnHandDiff="3"/> <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL03" inventoryItemId="9004" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-1111" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9004" inventoryItemDetailSeqId="0001" availableToPromiseDiff="50" quantityOnHandDiff="50"/> + <InventoryItemDetail inventoryItemId="9004" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="50" quantityOnHandDiff="50"/> <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL03" inventoryItemId="9005" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-1111" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9005" inventoryItemDetailSeqId="0001" availableToPromiseDiff="5" quantityOnHandDiff="5"/> + <InventoryItemDetail inventoryItemId="9005" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="5" quantityOnHandDiff="5"/> <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLUL04" inventoryItemId="9006" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-5569" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9006" inventoryItemDetailSeqId="0001" availableToPromiseDiff="10" quantityOnHandDiff="10"/> + <InventoryItemDetail inventoryItemId="9006" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" quantityOnHandDiff="10"/> <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9010" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-B3" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9010" inventoryItemDetailSeqId="0001" availableToPromiseDiff="10" quantityOnHandDiff="10"/> + <InventoryItemDetail inventoryItemId="9010" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" quantityOnHandDiff="10"/> <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9011" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-B4" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9011" inventoryItemDetailSeqId="0001" availableToPromiseDiff="10" quantityOnHandDiff="10"/> + <InventoryItemDetail inventoryItemId="9011" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" quantityOnHandDiff="10"/> <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9012" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-S3" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9012" inventoryItemDetailSeqId="0001" availableToPromiseDiff="10" quantityOnHandDiff="10"/> + <InventoryItemDetail inventoryItemId="9012" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" quantityOnHandDiff="10"/> <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9013" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="WG-9943-S4" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9013" inventoryItemDetailSeqId="0001" availableToPromiseDiff="10" quantityOnHandDiff="10"/> + <InventoryItemDetail inventoryItemId="9013" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="10" quantityOnHandDiff="10"/> <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9021" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-1" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9021" inventoryItemDetailSeqId="0001" availableToPromiseDiff="8" quantityOnHandDiff="8"/> + <InventoryItemDetail inventoryItemId="9021" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" quantityOnHandDiff="8"/> <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9022" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-2" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9022" inventoryItemDetailSeqId="0001" availableToPromiseDiff="8" quantityOnHandDiff="8"/> + <InventoryItemDetail inventoryItemId="9022" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" quantityOnHandDiff="8"/> <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9023" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-3" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9023" inventoryItemDetailSeqId="0001" availableToPromiseDiff="8" quantityOnHandDiff="8"/> + <InventoryItemDetail inventoryItemId="9023" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" quantityOnHandDiff="8"/> <InventoryItem facilityId="WebStoreWarehouse" inventoryItemId="9024" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="GZ-1006-4" ownerPartyId="Company" currencyUomId="USD" unitCost="0"/> - <InventoryItemDetail inventoryItemId="9024" inventoryItemDetailSeqId="0001" availableToPromiseDiff="8" quantityOnHandDiff="8"/> + <InventoryItemDetail inventoryItemId="9024" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="8" quantityOnHandDiff="8"/> <!-- Some additional test promotions --> <!-- GWP example on >$100 purchase --> Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?view=diff&rev=557939&r1=557938&r2=557939 ============================================================================== --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Fri Jul 20 02:33:09 2007 @@ -1219,6 +1219,7 @@ title="Inventory Item Detail Entity"> <field name="inventoryItemId" type="id-ne"></field> <field name="inventoryItemDetailSeqId" type="id-ne"></field> + <field name="effectiveDate" type="date-time"></field> <field name="quantityOnHandDiff" type="floating-point"></field> <field name="availableToPromiseDiff" type="floating-point"></field> <field name="orderId" type="id"></field> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?view=diff&rev=557939&r1=557938&r2=557939 ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Fri Jul 20 02:33:09 2007 @@ -233,6 +233,16 @@ <field-to-result field-name="newEntity.inventoryItemDetailSeqId" result-name="inventoryItemDetailSeqId"/> <set-nonpk-fields map-name="parameters" value-name="newEntity"/> + + <!-- set the effectiveDate; if from an ItemIssuance lookup the issuedDateTime --> + <if-not-empty field-name="parameters.itemIssuanceId"> + <entity-one entity-name="ItemIssuance" value-name="itemIssuance"/> + <set field="newEntity.effectiveDate" from-field="itemIssuance.issuedDateTime"/> + + <else> + <now-timestamp-to-env env-name="newEntity.effectiveDate"/> + </else> + </if-not-empty> <!-- if availableToPromiseDiff or quantityOnHandDiff are empty set to 0 --> <if-empty field-name="newEntity.availableToPromiseDiff"><set field="newEntity.availableToPromiseDiff" value="0" type="Double"/></if-empty> @@ -248,6 +258,7 @@ <set field="inventoryItem.quantityOnHandTotal" from-field="inventoryItemDetailSummary.quantityOnHandTotal"/> <store-value value-name="inventoryItem"/> </simple-method> + <simple-method method-name="updateSerializedInventoryTotals" short-description="Update the totals on serialized inventory"> <entity-one entity-name="InventoryItem" value-name="inventoryItem"/> <if-compare field-name="inventoryItem.inventoryItemTypeId" value="SERIALIZED_INV_ITEM" operator="equals"> @@ -310,6 +321,7 @@ </if> </if-compare> </simple-method> + <simple-method method-name="updateOldInventoryToDetailAll" short-description="Update Old Inventory To Detail All"> <!-- find all InventoryItem records where oldQuantityOnHand or oldAvailableToPromise are not null --> <entity-condition entity-name="InventoryItem" list-name="inventoryItemList"> Modified: ofbiz/trunk/applications/product/servicedef/services_facility.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_facility.xml?view=diff&rev=557939&r1=557938&r2=557939 ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services_facility.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services_facility.xml Fri Jul 20 02:33:09 2007 @@ -87,7 +87,9 @@ location="org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItemDetail" auth="true"> <description>Create an createInventoryItemDetail - note that the quantityOnHand and availableToPromise are relative (positive or negative) and will be added to the corresponding value on the given InventoryItem</description> <auto-attributes include="pk" mode="IN" optional="false"/> - <auto-attributes include="nonpk" mode="IN" optional="true"/> + <auto-attributes include="nonpk" mode="IN" optional="true"> + <exclude field-name="effectiveDate"/> + </auto-attributes> <override name="inventoryItemDetailSeqId" mode="OUT"/> </service> <service name="updateInventoryItemFromDetail" default-entity-name="InventoryItemDetail" engine="simple" |
Free forum by Nabble | Edit this page |