|
Author: lektran
Date: Fri Jun 15 14:53:59 2007 New Revision: 547806 URL: http://svn.apache.org/viewvc?view=rev&rev=547806 Log: Added defaultDaysToShip to the Facility entity for use during inventory reservation. promisedDatetime is now calculated as follows: 1. If set use ProductFacility.daysToShip 2. Otherwise use Facility.defaultDaysToShip 3. Otherwise use hard coded default of 30 days Modified: ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml ofbiz/trunk/applications/product/config/ProductUiLabels.properties ofbiz/trunk/applications/product/entitydef/entitymodel.xml ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml ofbiz/trunk/applications/product/webapp/facility/facility/EditFacility.ftl Modified: ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml?view=diff&rev=547806&r1=547805&r2=547806 ============================================================================== --- ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml (original) +++ ofbiz/trunk/applications/ecommerce/data/DemoProduct.xml Fri Jun 15 14:53:59 2007 @@ -19,7 +19,7 @@ --> <entity-engine-xml> - <Facility facilityId="WebStoreWarehouse" facilityTypeId="WAREHOUSE" facilityName="Web Store Warehouse" description="Warehouse exclusively for the Web Store " ownerPartyId="Company" defaultInventoryItemTypeId="NON_SERIAL_INV_ITEM" defaultWeightUomId="WT_lb"/> + <Facility facilityId="WebStoreWarehouse" facilityTypeId="WAREHOUSE" facilityName="Web Store Warehouse" description="Warehouse exclusively for the Web Store " ownerPartyId="Company" defaultInventoryItemTypeId="NON_SERIAL_INV_ITEM" defaultWeightUomId="WT_lb" defaultDaysToShip="25"/> <ContactMech contactMechId="9200" contactMechTypeId="POSTAL_ADDRESS"/> <ContactMech contactMechId="9201" contactMechTypeId="TELECOM_NUMBER"/> <PostalAddress contactMechId="9200" toName="Company XYZ" attnName="ZJAA" address1="2003 Open Blvd" city="Orem" postalCode="84058" countryGeoId="USA" stateProvinceGeoId="UT"/> Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?view=diff&rev=547806&r1=547805&r2=547806 ============================================================================== --- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original) +++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Fri Jun 15 14:53:59 2007 @@ -478,6 +478,7 @@ ProductDateReceived=Date Received ProductDaysToShip=Days To Ship ProductDefaultAmount=Default Amount +ProductDefaultDaysToShip=Default Days To Ship ProductDefaultPrice=Default Price ProductDefaultSequenceNumber=Default Sequence Number ProductDefaultsTo=Defaults to Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?view=diff&rev=547806&r1=547805&r2=547806 ============================================================================== --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Fri Jun 15 14:53:59 2007 @@ -2877,6 +2877,7 @@ <field name="primaryFacilityGroupId" type="id"></field> <field name="squareFootage" type="numeric"></field> <field name="productStoreId" type="id"></field> + <field name="defaultDaysToShip" type="numeric"><description>In the absence of a product specific days to ship in ProductFacility, this will be used</description></field> <field name="openedDate" type="date-time"></field> <field name="closedDate" type="date-time"></field> <field name="description" type="description"></field> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml?view=diff&rev=547806&r1=547805&r2=547806 ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml Fri Jun 15 14:53:59 2007 @@ -41,6 +41,7 @@ <!-- check the product; make sure its a physical item --> <entity-one entity-name="Product" value-name="product"/> + <entity-one entity-name="Facility" value-name="facility" use-cache="true"/> <get-related-one value-name="product" relation-name="ProductType" to-value-name="productType"/> <if-compare field-name="productType.isPhysical" operator="equals" value="N"> <set field="parameters.quantityNotReserved" value="0" type="Double"/> @@ -139,9 +140,16 @@ <!-- get the promiseDatetime --> <get-related-one value-name="lastNonSerInventoryItem" relation-name="ProductFacility" to-value-name="productFacility"/> + <clear-field field-name="daysToShip"/> <set field="daysToShip" from-field="productFacility.daysToShip"/> <if-empty field-name="daysToShip"> - <set field="daysToShip" value="30" type="Long"/> + <!-- if the product does not have its own days to ship, use Facility.defaultDaysToShip, if not then use 30 days as a USA industry default --> + <if-not-empty field-name="facility.defaultDaysToShip"> + <set field="daysToShip" from-field="facility.defaultDaysToShip" type="Long"/> + <else> + <set field="daysToShip" value="30" type="Long"/> + </else> + </if-not-empty> </if-empty> <call-bsh><