[OFBiz] SVN: r5638 - in trunk: applications/ecommerce/data applications/product/data applications/product/entitydef applications/product/script/org/ofbiz/product/price applications/product/servicedef applications/product/src/org/ofbiz/product/config applications/product/src/org/ofbiz/product/price applications/product/webapp/catalog/product framework/common/config specialized/opentravelsystem/webapp/hotelfrontend/data

jonesde at svn.ofbiz.org jonesde at svn.ofbiz.org
Sat Sep 3 08:27:01 EDT 2005


Author: jonesde
Date: 2005-09-03 07:26:24 -0500 (Sat, 03 Sep 2005)
New Revision: 5638

Modified:
   trunk/applications/ecommerce/data/DemoConfigurator.xml
   trunk/applications/ecommerce/data/DemoProduct.xml
   trunk/applications/ecommerce/data/DemoRentalProduct.xml
   trunk/applications/product/data/ProductTypeData.xml
   trunk/applications/product/entitydef/entitygroup.xml
   trunk/applications/product/entitydef/entitymodel.xml
   trunk/applications/product/script/org/ofbiz/product/price/PriceServices.xml
   trunk/applications/product/servicedef/services_pricepromo.xml
   trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java
   trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
   trunk/applications/product/webapp/catalog/product/ProductForms.xml
   trunk/framework/common/config/CommonUiLabels.properties
   trunk/specialized/opentravelsystem/webapp/hotelfrontend/data/HotelDemoStore.xml
Log:
Some changes in the ProductPrice table and the way calculateProductPrice works; in the past we had an over-use of the productPriceTypeId and have come up with a need to use some of those other price types, but along with the price calculation and such. The solution is to introduce the concept of the ProductPricePurpose, so we have a new table for that and a new field on the ProductPrice entity for the productPricePurposeId. Previous calculated prices are now considered to have the PURCHASE purpose, and for the calculateProductPrice service if you don't pass in the purpose you want it defaults to PURCHASE. Some previous ProductPriceTypes are no longer used as such and are now ProductPricePurposes, namely RECURRING_CHARGE, USAGE_CHARGE, and COMPONENT_PRICE. The real driving force behind this change is a need to support price calculation for RECURRING_CHARGE and COMPONENT_PRICE, and other custom or future price purposes. NOTE: this did require a primary key change for the ProductPrice table, the calculateProductPrice service will still support a null productPricePurposeId so that after an upgrade the whole system won't be useless, but that table or the pk on that table should be rebuilt right away for this change. All ProductPrice seed data has been updated to support this change.

Modified: trunk/applications/ecommerce/data/DemoConfigurator.xml
===================================================================
--- trunk/applications/ecommerce/data/DemoConfigurator.xml	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/ecommerce/data/DemoConfigurator.xml	2005-09-03 12:26:24 UTC (rev 5638)
@@ -7,13 +7,13 @@
     <Product productId="ETH_BRAND" productTypeId="FINISHED_GOOD" productName="Ethernet100" internalName="Ethernet Card 10/100" description="Ethernet Card 10/100" createdDate="2004-08-20 12:50:54.794" createdByUserLogin="admin"/>
     <Product productId="MOD_BRAND" productTypeId="FINISHED_GOOD" productName="Modem56k" internalName="Modem Card 56k" description="Modem Card 56k" createdDate="2004-08-20 12:50:54.794" createdByUserLogin="admin"/>
     
-    <ProductPrice productId="PC001" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:53.223" price="50" createdDate="2004-08-20 12:55:53.223" createdByUserLogin="admin"/>
-    <ProductPrice productId="RAM256_BRAND" productPriceTypeId="COMPONENT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:53.223" price="115" createdDate="2004-08-20 12:55:53.223" createdByUserLogin="admin"/>
-    <ProductPrice productId="RAM256_BRAND" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:36.479" price="120" createdDate="2004-08-20 12:55:36.479" createdByUserLogin="admin"/>
-    <ProductPrice productId="HD2GB_BRAND" productPriceTypeId="COMPONENT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:53.223" price="220" createdDate="2004-08-20 12:55:53.223" createdByUserLogin="admin"/>
-    <ProductPrice productId="HD4GB_BRAND" productPriceTypeId="COMPONENT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:36.479" price="420" createdDate="2004-08-20 12:55:36.479" createdByUserLogin="admin"/>
-    <ProductPrice productId="ETH_BRAND" productPriceTypeId="COMPONENT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:36.479" price="18" createdDate="2004-08-20 12:55:36.479" createdByUserLogin="admin"/>
-    <ProductPrice productId="MOD_BRAND" productPriceTypeId="COMPONENT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:36.479" price="15" createdDate="2004-08-20 12:55:36.479" createdByUserLogin="admin"/>
+    <ProductPrice productId="PC001" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:53.223" price="50" createdDate="2004-08-20 12:55:53.223" createdByUserLogin="admin"/>
+    <ProductPrice productId="RAM256_BRAND" productPricePurposeId="COMPONENT_PRICE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:53.223" price="115" createdDate="2004-08-20 12:55:53.223" createdByUserLogin="admin"/>
+    <ProductPrice productId="RAM256_BRAND" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:36.479" price="120" createdDate="2004-08-20 12:55:36.479" createdByUserLogin="admin"/>
+    <ProductPrice productId="HD2GB_BRAND" productPricePurposeId="COMPONENT_PRICE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:53.223" price="220" createdDate="2004-08-20 12:55:53.223" createdByUserLogin="admin"/>
+    <ProductPrice productId="HD4GB_BRAND" productPricePurposeId="COMPONENT_PRICE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:36.479" price="420" createdDate="2004-08-20 12:55:36.479" createdByUserLogin="admin"/>
+    <ProductPrice productId="ETH_BRAND" productPricePurposeId="COMPONENT_PRICE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:36.479" price="18" createdDate="2004-08-20 12:55:36.479" createdByUserLogin="admin"/>
+    <ProductPrice productId="MOD_BRAND" productPricePurposeId="COMPONENT_PRICE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2004-08-20 12:55:36.479" price="15" createdDate="2004-08-20 12:55:36.479" createdByUserLogin="admin"/>
     
     <ProductConfigItem configItemId="IT0000" configItemTypeId="SINGLE" configItemName="RAM (brand)" description="Select the memory configuration:"/>
     <ProductConfigItem configItemId="IT0001" configItemTypeId="SINGLE" configItemName="HD (brand)" description="Select the Hard Disk:"/>

Modified: trunk/applications/ecommerce/data/DemoProduct.xml
===================================================================
--- trunk/applications/ecommerce/data/DemoProduct.xml	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/ecommerce/data/DemoProduct.xml	2005-09-03 12:26:24 UTC (rev 5638)
@@ -161,35 +161,35 @@
     <Product productId="WG-9943-S3" productTypeId="FINISHED_GOOD" primaryProductCategoryId="202" productName="Giant Widget S3" internalName="Giant Widget S3" description="Silver Giant Widget with 3 Wheels" longDescription="This giant widget is mobile. It will seat one person safely. The wheels will never rust or break. Quite a unique item." quantityIncluded="10.0" weight="22.0" isVariant="Y"/>
     <Product productId="WG-9943-S4" productTypeId="FINISHED_GOOD" primaryProductCategoryId="202" productName="Giant Widget S4" internalName="Giant Widget S4" description="Silver Giant Widget with 4 Wheels" longDescription="This giant widget is mobile. It will seat one person safely. The wheels will never rust or break. Quite a unique item." quantityIncluded="10.0" weight="22.0" isVariant="Y"/>
 
-    <ProductPrice productId="GZ-1000" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:49:03.163" price="15.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1000" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:48:49.113" price="15.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1001" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:38.033" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1001" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:29.421" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1004" productPriceTypeId="AVERAGE_COST" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:35.866" price="29.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1004" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:45.25" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1005" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:00:47.616" price="2799.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1005" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:00:32.034" price="2799.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1006" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:03:12.745" price="1.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-1006" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:03:03.151" price="5.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-2002" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:52:45.463" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-2002" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:52:37.181" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-2644" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-2644" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-5005" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:06:07.516" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:06:17.991" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-5005" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:05:56.39" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:06:07.286" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-7000" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:12:00.424" price="599.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:12:08.765" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-7000" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:12:09.006" price="999.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:12:22.736" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-8544" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="269.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-8544" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="270.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-9290" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:55:00.196" price="97.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GZ-9290" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:54:52.065" price="99.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="WG-1111" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="59.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="WG-1111" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="60.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="WG-5569" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="59.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="WG-5569" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="60.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="WG-9943" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="549.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="WG-9943" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="550.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="WG-9943" productPriceTypeId="COMPETITIVE_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="922.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1000" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:49:03.163" price="15.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1000" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:48:49.113" price="15.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1001" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:38.033" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1001" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:29.421" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1004" productPricePurposeId="PURCHASE" productPriceTypeId="AVERAGE_COST" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:35.866" price="29.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1004" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:45.25" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1005" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:00:47.616" price="2799.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1005" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:00:32.034" price="2799.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1006" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:03:12.745" price="1.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-1006" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:03:03.151" price="5.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-2002" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:52:45.463" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-2002" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:52:37.181" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-2644" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-2644" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-5005" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:06:07.516" price="47.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:06:17.991" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-5005" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:05:56.39" price="48.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:06:07.286" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-7000" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:12:00.424" price="599.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:12:08.765" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-7000" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 19:12:09.006" price="999.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2003-03-04 19:12:22.736" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-8544" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="269.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-8544" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="270.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-9290" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:55:00.196" price="97.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GZ-9290" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2003-03-04 18:54:52.065" price="99.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="WG-1111" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="59.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="WG-1111" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="60.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="WG-5569" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="59.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="WG-5569" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="60.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="WG-9943" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="549.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="WG-9943" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="550.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="WG-9943" productPricePurposeId="PURCHASE" productPriceTypeId="COMPETITIVE_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="922.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
 
     <ProductFeatureCategory productFeatureCategoryId="8000" description="License Features"/>
     <ProductFeatureCategoryAppl productFeatureCategoryId="8000" productCategoryId="CATALOG1_SEARCH" fromDate="2001-05-13 12:00:00.0"/>
@@ -546,17 +546,17 @@
     <ProductAssoc productId="GC-001" productIdTo="GC-001-H25" productAssocTypeId="PRODUCT_VARIANT" fromDate="2001-05-13 12:00:00.0"/>
     <ProductAssoc productId="GC-001" productIdTo="GC-001-H50" productAssocTypeId="PRODUCT_VARIANT" fromDate="2001-05-13 12:00:00.0"/>
     <ProductAssoc productId="GC-001" productIdTo="GC-001-HO" productAssocTypeId="PRODUCT_VARIANT" fromDate="2001-05-13 12:00:00.0"/>
-    <ProductPrice productId="GC-002" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="1.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-C10" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="10.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-C100" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="100.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-C25" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="25.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-C50" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="50.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-CO" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="1.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-H10" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="10.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-H100" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="100.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-H25" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="25.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-H50" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="50.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="GC-001-HO" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="1.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-002" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="1.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-C10" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="10.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-C100" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="100.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-C25" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="25.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-C50" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="50.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-CO" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="1.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-H10" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="10.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-H100" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="100.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-H25" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="25.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-H50" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="50.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="GC-001-HO" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="1.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     <ProductCategoryMember productCategoryId="GC-100" productId="GC-001" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="GC-100" productId="GC-002" fromDate="2001-05-13 12:00:00.0"/>
     <ProductCategoryMember productCategoryId="GC-102" productId="GC-002" fromDate="2001-05-13 12:00:00.0"/>

Modified: trunk/applications/ecommerce/data/DemoRentalProduct.xml
===================================================================
--- trunk/applications/ecommerce/data/DemoRentalProduct.xml	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/ecommerce/data/DemoRentalProduct.xml	2005-09-03 12:26:24 UTC (rev 5638)
@@ -105,16 +105,16 @@
 
     <Product productId="Cap" productTypeId="FINISHED_GOOD" productName="Cap with hotel Logo" internalName="Cap" description="A cap with the hotel logo" longDescription="This is the nicest cap you have ever seen with the hotel logo in gold!"  taxable="Y" chargeShipping="Y" autoCreateKeywords="Y" isVirtual="N" isVariant="N" createdDate="2004-03-04 18:48:34.612" createdByUserLogin="admin" lastModifiedDate="2004-03-04 18:48:34.612" lastModifiedByUserLogin="admin"/>
     <!-- product prices -->
-    <ProductPrice productId="RoomStd" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:49:03.163" price="15.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="RoomStd" productPriceTypeId="LIST_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:48:49.113" price="15.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="RoomLux" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:38.033" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="RoomLux" productPriceTypeId="LIST_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:29.421" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="RoomLarge" productPriceTypeId="AVERAGE_COST" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:35.866" price="29.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="RoomLarge" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:45.25" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="BoatRowSimple" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="549.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="BoatRowSimple" productPriceTypeId="LIST_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="550.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="BoatRowSimple" productPriceTypeId="COMPETITIVE_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="922.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
-    <ProductPrice productId="Cap" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:45.25" price="5.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="RoomStd" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:49:03.163" price="15.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="RoomStd" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:48:49.113" price="15.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="RoomLux" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:38.033" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="RoomLux" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:57:29.421" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="RoomLarge" productPricePurposeId="PURCHASE" productPriceTypeId="AVERAGE_COST" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:35.866" price="29.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="RoomLarge" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:45.25" price="25.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="BoatRowSimple" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="549.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="BoatRowSimple" productPricePurposeId="PURCHASE" productPriceTypeId="LIST_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="550.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="BoatRowSimple" productPricePurposeId="PURCHASE" productPriceTypeId="COMPETITIVE_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="922.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
+    <ProductPrice productId="Cap" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="EUR" productStoreGroupId="_NA_" fromDate="2003-03-04 18:50:45.25" price="5.99" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
     
     <!-- allocate products to categories -->
     <ProductCategoryMember productCategoryId="RentalPromo" productId="RoomLux" fromDate="2004-10-18 20:39:58.563" lastUpdatedStamp="2004-10-18 20:40:12.411" lastUpdatedTxStamp="2004-10-18 20:40:12.411" createdStamp="2004-10-18 20:40:12.411" createdTxStamp="2004-10-18 20:40:12.411"/>

Modified: trunk/applications/product/data/ProductTypeData.xml
===================================================================
--- trunk/applications/product/data/ProductTypeData.xml	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/product/data/ProductTypeData.xml	2005-09-03 12:26:24 UTC (rev 5638)
@@ -268,11 +268,13 @@
     <ProductPriceType description="Maximum Price" productPriceTypeId="MAXIMUM_PRICE"/>
     <ProductPriceType description="Promotional Price" productPriceTypeId="PROMO_PRICE"/>
     <ProductPriceType description="Competitive Price" productPriceTypeId="COMPETITIVE_PRICE"/>
-    <ProductPriceType description="Recurring Charge" productPriceTypeId="RECURRING_CHARGE"/>
-    <ProductPriceType description="Usage Charge" productPriceTypeId="USAGE_CHARGE"/>
-    <ProductPriceType description="Component Price" productPriceTypeId="COMPONENT_PRICE"/>
     <ProductPriceType description="Wholesale Price" productPriceTypeId="WHOLESALE_PRICE"/>
 
+    <ProductPricePurpose description="Purchase/Initial" productPricePurposeId="PURCHASE"/>
+    <ProductPricePurpose description="Recurring Charge" productPricePurposeId="RECURRING_CHARGE"/>
+    <ProductPricePurpose description="Usage Charge" productPricePurposeId="USAGE_CHARGE"/>
+    <ProductPricePurpose description="Component Price" productPricePurposeId="COMPONENT_PRICE"/>
+    
     <ProductPriceActionType description="Percent Of List Price" productPriceActionTypeId="PRICE_POL"/>
     <ProductPriceActionType description="Percent Of Default Price" productPriceActionTypeId="PRICE_POD"/>
     <ProductPriceActionType description="Percent Of Average Cost" productPriceActionTypeId="PRICE_POAC"/>

Modified: trunk/applications/product/entitydef/entitygroup.xml
===================================================================
--- trunk/applications/product/entitydef/entitygroup.xml	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/product/entitydef/entitygroup.xml	2005-09-03 12:26:24 UTC (rev 5638)
@@ -52,6 +52,20 @@
     <entity-group group="org.ofbiz" entity="ProductCategoryType" />
     <entity-group group="org.ofbiz" entity="ProductCategoryTypeAttr" />
 
+    <!-- ========================================================= -->
+    <!-- org.ofbiz.product.config -->
+    <!-- ========================================================= -->
+    
+    <entity-group group="org.ofbiz" entity="ProductConfig" />
+    <entity-group group="org.ofbiz" entity="ProductConfigItem" />
+    <entity-group group="org.ofbiz" entity="ProdConfItemContent" />
+    <entity-group group="org.ofbiz" entity="ProdConfItemContentType" />
+    <entity-group group="org.ofbiz" entity="ProductConfigOption" />
+    <entity-group group="org.ofbiz" entity="ProductConfigOptionIactn" />
+    <entity-group group="org.ofbiz" entity="ProductConfigProduct" />
+    <entity-group group="org.ofbiz" entity="ProductConfigConfig" />
+    <entity-group group="org.ofbiz" entity="ProductConfigStats" />
+    
   <!-- ========================================================= -->
   <!-- org.ofbiz.product.cost -->
   <!-- ========================================================= -->
@@ -113,12 +127,14 @@
   <!-- org.ofbiz.product.price -->
   <!-- ========================================================= -->
 
+    <entity-group group="org.ofbiz" entity="ProductPaymentMethodType" />
     <entity-group group="org.ofbiz" entity="ProductPrice" />
     <entity-group group="org.ofbiz" entity="ProductPriceAction" />
     <entity-group group="org.ofbiz" entity="ProductPriceActionType" />
     <entity-group group="org.ofbiz" entity="ProductPriceAutoNotice" />
     <entity-group group="org.ofbiz" entity="ProductPriceChange" />
     <entity-group group="org.ofbiz" entity="ProductPriceCond" />
+    <entity-group group="org.ofbiz" entity="ProductPricePurpose" />
     <entity-group group="org.ofbiz" entity="ProductPriceRule" />
     <entity-group group="org.ofbiz" entity="ProductPriceType" />
     <entity-group group="org.ofbiz" entity="QuantityBreak" />
@@ -280,19 +296,5 @@
     <entity-group group="org.ofbiz" entity="ShipmentTypeAttr" />
     <entity-group group="org.ofbiz" entity="ShippingDocument" />
     
-  <!-- ========================================================= -->
-  <!-- org.ofbiz.product.config -->
-  <!-- ========================================================= -->
-
-    <entity-group group="org.ofbiz" entity="ProductConfig" />
-    <entity-group group="org.ofbiz" entity="ProductConfigItem" />
-    <entity-group group="org.ofbiz" entity="ProdConfItemContent" />
-    <entity-group group="org.ofbiz" entity="ProdConfItemContentType" />
-    <entity-group group="org.ofbiz" entity="ProductConfigOption" />
-    <entity-group group="org.ofbiz" entity="ProductConfigOptionIactn" />
-    <entity-group group="org.ofbiz" entity="ProductConfigProduct" />
-    <entity-group group="org.ofbiz" entity="ProductConfigConfig" />
-    <entity-group group="org.ofbiz" entity="ProductConfigStats" />
-
 </entitygroup>
 

Modified: trunk/applications/product/entitydef/entitymodel.xml
===================================================================
--- trunk/applications/product/entitydef/entitymodel.xml	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/product/entitydef/entitymodel.xml	2005-09-03 12:26:24 UTC (rev 5638)
@@ -1,8 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-/**
- *  Title: Entity Generator Definitions for the General Data Model
- *  Description: None
  *  Copyright (c) 2001-2005 The Open For Business Project - www.ofbiz.org
  *
  *  Permission is hereby granted, free of charge, to any person obtaining a
@@ -26,41 +23,41 @@
  * @author     David E. Jones (jonesde at ofbiz.org)
  * @author     Andy Zeneski (jaz at ofbiz.org)
  * @version    $Rev$
- */
 -->
 
 <entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
-  <!-- ========================================================= -->
-  <!-- ======================== Defaults ======================= -->
-  <!-- ========================================================= -->
+        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
+    <!-- ========================================================= -->
+    <!-- ======================== Defaults ======================= -->
+    <!-- ========================================================= -->
     <title>Entity of an Open For Business Project Component</title>
     <description>None</description>
     <copyright>Copyright (c) 2001-2005 The Open For Business Project - www.ofbiz.org</copyright>
     <author>None</author>
     <version>1.0</version>
 
-  <!-- ========================================================= -->
-  <!-- ======================== Data Model ===================== -->
-  <!-- The modules in this file are as follows:                  -->
-  <!--  - org.ofbiz.product.catalog -->
-  <!--  - org.ofbiz.product.category -->
-  <!--  - org.ofbiz.product.cost -->
-  <!--  - org.ofbiz.product.feature -->
-  <!--  - org.ofbiz.product.inventory -->
-  <!--  - org.ofbiz.product.location -->
-  <!--  - org.ofbiz.product.price -->
-  <!--  - org.ofbiz.product.product -->
-  <!--  - org.ofbiz.product.promo -->
-  <!--  - org.ofbiz.product.storage -->
-  <!--  - org.ofbiz.product.store -->
-  <!--  - org.ofbiz.product.supplier -->
-  <!-- ========================================================= -->
+    <!-- ========================================================= -->
+    <!-- ======================== Data Model ===================== -->
+    <!-- The modules in this file are as follows:                  -->
+    <!--  - org.ofbiz.product.catalog -->
+    <!--  - org.ofbiz.product.category -->
+    <!--  - org.ofbiz.product.config -->
+    <!--  - org.ofbiz.product.cost -->
+    <!--  - org.ofbiz.product.feature -->
+    <!--  - org.ofbiz.product.inventory -->
+    <!--  - org.ofbiz.product.location -->
+    <!--  - org.ofbiz.product.price -->
+    <!--  - org.ofbiz.product.product -->
+    <!--  - org.ofbiz.product.promo -->
+    <!--  - org.ofbiz.product.storage -->
+    <!--  - org.ofbiz.product.store -->
+    <!--  - org.ofbiz.product.supplier -->
+    <!-- ========================================================= -->
 
 
-  <!-- ========================================================= -->
-  <!-- org.ofbiz.product.catalog -->
-  <!-- ========================================================= -->
+    <!-- ========================================================= -->
+    <!-- org.ofbiz.product.catalog -->
+    <!-- ========================================================= -->
 
     <entity entity-name="ProdCatalog"
             package-name="org.ofbiz.product.catalog"
@@ -472,7 +469,179 @@
         <key-map field-name="productCategoryTypeId"/>
       </relation>
     </entity>
-
+    
+    <!-- ========================================================= -->
+    <!-- org.ofbiz.product.config -->
+    <!-- ========================================================= -->
+    
+    <entity entity-name="ProductConfig"
+            package-name="org.ofbiz.product.config"
+            title="Product Configuration Templates Entity">
+        <field name="productId" type="id-ne"></field>
+        <field name="configItemId" type="id-ne"></field>
+        <field name="sequenceNum" type="numeric"></field>
+        <field name="fromDate" type="date-time"></field>
+        <field name="description" type="description"></field>
+        <field name="longDescription" type="very-long"></field>
+        <field name="configTypeId" type="id"></field>
+        <field name="thruDate" type="date-time"></field>
+        <field name="isMandatory" type="indicator"></field>
+        <prim-key field="productId"/>
+        <prim-key field="configItemId"/>
+        <prim-key field="sequenceNum"/>
+        <prim-key field="fromDate"/>
+        <relation type="one" fk-name="PROD_CONF_PROD" title="Product" rel-entity-name="Product">
+            <key-map field-name="productId"/>
+        </relation>
+        <relation type="one" fk-name="PROD_CONF_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
+            <key-map field-name="configItemId"/>
+        </relation>
+    </entity>
+    <entity entity-name="ProductConfigItem"
+            package-name="org.ofbiz.product.config"
+            title="Product Configuration Question Entity">
+        <field name="configItemId" type="id-ne"></field>
+        <field name="configItemTypeId" type="id"></field>
+        <field name="configItemName" type="name"></field>
+        <field name="description" type="description"></field>
+        <field name="longDescription" type="very-long"></field>
+        <field name="imageUrl" type="url"></field>
+        <prim-key field="configItemId"/>
+    </entity>
+    <entity entity-name="ProdConfItemContent"
+            package-name="org.ofbiz.product.config"
+            title="Product Configuration Question Data Object Entity">
+        <field name="configItemId" type="id-ne"></field>
+        <field name="contentId" type="id-ne"></field>
+        <field name="confItemContentTypeId" type="id-ne"></field>
+        <field name="fromDate" type="date-time"></field>
+        <field name="thruDate" type="date-time"></field>
+        <prim-key field="configItemId"/>
+        <prim-key field="contentId"/>
+        <prim-key field="confItemContentTypeId"/>
+        <prim-key field="fromDate"/>
+        <relation type="one" fk-name="CIMT_CNT_PCIT" rel-entity-name="ProductConfigItem">
+            <key-map field-name="configItemId"/>
+        </relation>
+        <relation type="one" fk-name="CIMT_CNT_CNT" rel-entity-name="Content">
+            <key-map field-name="contentId"/>
+        </relation>
+        <relation type="one" fk-name="CIMT_CNT_TYPE" rel-entity-name="ProdConfItemContentType">
+            <key-map field-name="confItemContentTypeId"/>
+        </relation>
+    </entity>
+    <entity entity-name="ProdConfItemContentType"
+            package-name="org.ofbiz.product.product"
+            title="Product Content Type Entity">
+        <field name="confItemContentTypeId" type="id-ne"></field>
+        <field name="parentTypeId" type="id"></field>
+        <field name="hasTable" type="indicator"></field>
+        <field name="description" type="description"></field>
+        <prim-key field="confItemContentTypeId"/>
+        <relation type="one" fk-name="PCICT_TYP_PARENT" title="Parent" rel-entity-name="ProdConfItemContentType">
+            <key-map field-name="parentTypeId" rel-field-name="confItemContentTypeId"/>
+        </relation>
+    </entity>
+    <entity entity-name="ProductConfigOption"
+            package-name="org.ofbiz.product.config"
+            title="Product Configuration Options Entity">
+        <field name="configItemId" type="id-ne"></field>
+        <field name="configOptionId" type="id-ne"></field>
+        <field name="configOptionName" type="name"></field>
+        <field name="description" type="description"></field>
+        <field name="sequenceNum" type="numeric"></field>
+        <prim-key field="configItemId"/>
+        <prim-key field="configOptionId"/>
+        <relation type="one" fk-name="PROD_OPTN_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
+            <key-map field-name="configItemId"/>
+        </relation>
+    </entity>
+    <entity entity-name="ProductConfigOptionIactn"
+            package-name="org.ofbiz.product.config"
+            title="Product Configuration Options Entity">
+        <field name="configItemId" type="id-ne"></field>
+        <field name="configOptionId" type="id-ne"></field>
+        <field name="configItemIdTo" type="id-ne"></field>
+        <field name="configOptionIdTo" type="id-ne"></field>
+        <field name="sequenceNum" type="numeric"></field>
+        <field name="configIactnTypeId" type="id"></field> <!-- INCOMPATIBLE, etc... -->
+        <field name="description" type="description"></field>
+        <prim-key field="configItemId"/>
+        <prim-key field="configOptionId"/>
+        <prim-key field="configItemIdTo"/>
+        <prim-key field="configOptionIdTo"/>
+        <prim-key field="sequenceNum"/> <!-- OPTIONAL -->
+        <relation type="one" fk-name="PROD_OPTIA_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
+            <key-map field-name="configItemId"/>
+        </relation>
+        <relation type="one" fk-name="PROD_OPTIA_OPTN" title="ConfigOption" rel-entity-name="ProductConfigOption">
+            <key-map field-name="configItemId"/>
+            <key-map field-name="configOptionId"/>
+        </relation>
+        <relation type="one" fk-name="PROD_OPTIA_ITMT" title="ConfigItemTo" rel-entity-name="ProductConfigItem">
+            <key-map field-name="configItemIdTo" rel-field-name="configItemId"/>
+        </relation>
+        <relation type="one" fk-name="PROD_OPTIA_OPTT" title="ConfigOptionTo" rel-entity-name="ProductConfigOption">
+            <key-map field-name="configItemIdTo" rel-field-name="configItemId"/>
+            <key-map field-name="configOptionIdTo" rel-field-name="configOptionId"/>
+        </relation>
+    </entity>
+    <entity entity-name="ProductConfigProduct"
+            package-name="org.ofbiz.product.config"
+            title="Product Configuration Option to Products Entity">
+        <field name="configItemId" type="id-ne"></field>
+        <field name="configOptionId" type="id-ne"></field>
+        <field name="productId" type="id-ne"></field>
+        <field name="quantity" type="floating-point"></field>
+        <field name="sequenceNum" type="numeric"></field>
+        <prim-key field="configItemId"/>
+        <prim-key field="configOptionId"/>
+        <prim-key field="productId"/>
+        <relation type="one" fk-name="PROD_CONFP_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
+            <key-map field-name="configItemId"/>
+        </relation>
+        <relation type="one" fk-name="PROD_CONFP_OPTN" title="ConfigOption" rel-entity-name="ProductConfigOption">
+            <key-map field-name="configItemId"/>
+            <key-map field-name="configOptionId"/>
+        </relation>
+        <relation type="one" fk-name="PROD_CONFP_PROD" title="Product" rel-entity-name="Product">
+            <key-map field-name="productId"/>
+        </relation>
+    </entity>
+    <entity entity-name="ProductConfigConfig"
+            package-name="org.ofbiz.product.config"
+            title="Existing Product Configurations Entity">
+        <field name="configId" type="id-ne"></field>
+        <field name="configItemId" type="id-ne"></field>
+        <field name="sequenceNum" type="numeric"></field>
+        <field name="configOptionId" type="id-ne"></field>
+        <field name="description" type="description"></field>
+        <prim-key field="configId"/>
+        <prim-key field="configItemId"/>
+        <prim-key field="configOptionId"/>
+        <prim-key field="sequenceNum"/>
+        <relation type="one" fk-name="PROD_CONFC_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
+            <key-map field-name="configItemId"/>
+        </relation>
+        <relation type="one" fk-name="PROD_CONFC_OPTN" title="ConfigOption" rel-entity-name="ProductConfigOption">
+            <key-map field-name="configItemId"/>
+            <key-map field-name="configOptionId"/>
+        </relation>
+    </entity>
+    <entity entity-name="ProductConfigStats"
+            package-name="org.ofbiz.product.config"
+            title="Product Configurations Stats Entity">
+        <field name="configId" type="id-ne"></field>
+        <field name="productId" type="id-ne"></field>
+        <field name="numOfConfs" type="numeric"></field>
+        <field name="configTypeId" type="id"></field> <!-- HIDDEN, TEMPLATE, etc... -->
+        <prim-key field="configId"/>
+        <prim-key field="productId"/>
+        <relation type="one" fk-name="PROD_CONFS_PROD" title="Product" rel-entity-name="Product">
+            <key-map field-name="productId"/>
+        </relation>
+    </entity>
+    
   <!-- ========================================================= -->
   <!-- org.ofbiz.product.cost -->
   <!-- ========================================================= -->
@@ -1260,23 +1429,48 @@
   <!-- org.ofbiz.product.price -->
   <!-- ========================================================= -->
 
+    <entity entity-name="ProductPaymentMethodType"
+            package-name="org.ofbiz.product.price"
+            title="Product PaymentMethodType Entity">
+        <field name="productId" type="id-ne"></field>
+        <field name="paymentMethodTypeId" type="id-ne"></field>
+        <field name="productPricePurposeId" type="id-ne"></field>
+        <field name="fromDate" type="date-time"></field>
+        <field name="thruDate" type="date-time"></field>
+        <field name="sequenceNum" type="numeric"></field>
+        <prim-key field="productId"/>
+        <prim-key field="paymentMethodTypeId"/>
+        <prim-key field="productPricePurposeId"/>
+        <prim-key field="fromDate"/>
+        <relation type="one" fk-name="PROD_PMT_PROD" rel-entity-name="Product">
+            <key-map field-name="productId"/>
+        </relation>
+        <relation type="one" fk-name="PROD_PMT_PMT" rel-entity-name="PaymentMethodType">
+            <key-map field-name="paymentMethodTypeId"/>
+        </relation>
+        <relation type="one" fk-name="PROD_PMT_PPRP" rel-entity-name="ProductPricePurpose">
+            <key-map field-name="productPricePurposeId"/>
+        </relation>
+    </entity>
     <entity entity-name="ProductPrice"
             package-name="org.ofbiz.product.price"
             title="Product Price Entity">
       <field name="productId" type="id-ne"></field>
       <field name="productPriceTypeId" type="id-ne"></field>
+      <field name="productPricePurposeId" type="id-ne"></field>
       <field name="currencyUomId" type="id"></field>
       <field name="productStoreGroupId" type="id"></field>
       <field name="fromDate" type="date-time"></field>
       <field name="thruDate" type="date-time"></field>
       <field name="price" type="currency-amount"></field>
-      <field name="timeFreqUomId" type="id"></field>
+      <field name="termUomId" type="id"><!-- mainly used for recurring and usage prices to specify a time/freq measure, or a usage unit measure (bits, minutes, etc) --></field>
       <field name="createdDate" type="date-time"></field>
       <field name="createdByUserLogin" type="id-vlong"></field>
       <field name="lastModifiedDate" type="date-time"></field>
       <field name="lastModifiedByUserLogin" type="id-vlong"></field>
       <prim-key field="productId"/>
       <prim-key field="productPriceTypeId"/>
+      <prim-key field="productPricePurposeId"/>
       <prim-key field="currencyUomId"/>
       <prim-key field="productStoreGroupId"/>
       <prim-key field="fromDate"/>
@@ -1286,11 +1480,14 @@
       <relation type="one" fk-name="PROD_PRICE_TYPE" rel-entity-name="ProductPriceType">
         <key-map field-name="productPriceTypeId"/>
       </relation>
+      <relation type="one" fk-name="PROD_PRICE_PURP" rel-entity-name="ProductPricePurpose">
+        <key-map field-name="productPricePurposeId"/>
+      </relation>
       <relation type="one" fk-name="PROD_PRICE_CUOM" title="Currency" rel-entity-name="Uom">
         <key-map field-name="currencyUomId" rel-field-name="uomId"/>
       </relation>
-      <relation type="one" fk-name="PROD_PRICE_TFUOM" title="TimeFreq" rel-entity-name="Uom">
-        <key-map field-name="timeFreqUomId" rel-field-name="uomId"/>
+      <relation type="one" fk-name="PROD_PRICE_TUOM" title="Term" rel-entity-name="Uom">
+        <key-map field-name="termUomId" rel-field-name="uomId"/>
       </relation>
       <relation type="one" fk-name="PROD_PRICE_PSTG" rel-entity-name="ProductStoreGroup">
         <key-map field-name="productStoreGroupId"/>
@@ -1341,6 +1538,7 @@
       <field name="productPriceChangeId" type="id-ne"></field>
       <field name="productId" type="id-ne"></field>
       <field name="productPriceTypeId" type="id-ne"></field>
+      <field name="productPricePurposeId" type="id-ne"></field>
       <field name="currencyUomId" type="id"></field>
       <field name="productStoreGroupId" type="id"></field>
       <field name="fromDate" type="date-time"></field>
@@ -1353,6 +1551,7 @@
       <relation type="one-nofk" rel-entity-name="ProductPrice">
         <key-map field-name="productId"/>
         <key-map field-name="productPriceTypeId"/>
+        <key-map field-name="productPricePurposeId"/>
         <key-map field-name="currencyUomId"/>
         <key-map field-name="productStoreGroupId"/>
         <key-map field-name="fromDate"/>
@@ -1381,6 +1580,13 @@
         <key-map field-name="operatorEnumId" rel-field-name="enumId"/>
       </relation>
     </entity>
+    <entity entity-name="ProductPricePurpose"
+            package-name="org.ofbiz.product.price"
+            title="Product Price Purpose Entity">
+        <field name="productPricePurposeId" type="id-ne"></field>
+        <field name="description" type="description"></field>
+        <prim-key field="productPricePurposeId"/>
+    </entity>
     <entity entity-name="ProductPriceRule"
             package-name="org.ofbiz.product.price"
             title="Product Pice Rule Entity">
@@ -1688,8 +1894,8 @@
       </relation>
     </entity>
     <entity entity-name="ProductCalculatedInfo"
-        package-name="org.ofbiz.product.product"
-        title="Product Calculated Info Entity">
+            package-name="org.ofbiz.product.product"
+            title="Product Calculated Info Entity">
         <field name="productId" type="id-ne"></field>
         <field name="totalQuantityOrdered" type="floating-point"></field>
         <field name="totalTimesViewed" type="numeric"></field>
@@ -1734,8 +1940,8 @@
       </relation>
     </entity>
     <view-entity entity-name="ProductContentAndInfo"
-                package-name="org.ofbiz.product.category"
-                title="ProductContent, Content and DataResource View Entity">
+            package-name="org.ofbiz.product.product"
+            title="ProductContent, Content and DataResource View Entity">
       <member-entity entity-alias="PC" entity-name="ProductContent"/>
       <member-entity entity-alias="CO" entity-name="Content"/>
       <member-entity entity-alias="DR" entity-name="DataResource"/>
@@ -3186,7 +3392,8 @@
         <key-map field-name="currencyUomId" rel-field-name="uomId"/>
       </relation>
     </entity>
-    <entity entity-name="SupplierProductFeature" package-name="org.ofbiz.product.supplier"
+    <entity entity-name="SupplierProductFeature" 
+            package-name="org.ofbiz.product.supplier"
             title="Supplier-specific product feature information">
       <field name="partyId" type="id-ne"/>
       <field name="productFeatureId" type="id-ne"/>
@@ -3212,178 +3419,4 @@
       <field name="description" type="description"></field>
       <prim-key field="supplierRatingTypeId"/>
     </entity>
-
-  <!-- ========================================================= -->
-  <!-- org.ofbiz.product.config -->
-  <!-- ========================================================= -->
-
-    <entity entity-name="ProductConfig"
-            package-name="org.ofbiz.product.config"
-            title="Product Configuration Templates Entity">
-      <field name="productId" type="id-ne"></field>
-      <field name="configItemId" type="id-ne"></field>
-      <field name="sequenceNum" type="numeric"></field>
-      <field name="fromDate" type="date-time"></field>
-      <field name="description" type="description"></field>
-      <field name="longDescription" type="very-long"></field>
-      <field name="configTypeId" type="id"></field>
-      <field name="thruDate" type="date-time"></field>
-      <field name="isMandatory" type="indicator"></field>
-      <prim-key field="productId"/>
-      <prim-key field="configItemId"/>
-      <prim-key field="sequenceNum"/>
-      <prim-key field="fromDate"/>
-      <relation type="one" fk-name="PROD_CONF_PROD" title="Product" rel-entity-name="Product">
-        <key-map field-name="productId"/>
-      </relation>
-      <relation type="one" fk-name="PROD_CONF_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
-        <key-map field-name="configItemId"/>
-      </relation>
-    </entity>
-    <entity entity-name="ProductConfigItem"
-            package-name="org.ofbiz.product.config"
-            title="Product Configuration Question Entity">
-      <field name="configItemId" type="id-ne"></field>
-      <field name="configItemTypeId" type="id"></field>
-      <field name="configItemName" type="name"></field>
-      <field name="description" type="description"></field>
-      <field name="longDescription" type="very-long"></field>
-      <field name="imageUrl" type="url"></field>
-      <prim-key field="configItemId"/>
-    </entity>
-    <entity entity-name="ProdConfItemContent"
-            package-name="org.ofbiz.product.config"
-            title="Product Configuration Question Data Object Entity">
-      <field name="configItemId" type="id-ne"></field>
-      <field name="contentId" type="id-ne"></field>
-      <field name="confItemContentTypeId" type="id-ne"></field>
-      <field name="fromDate" type="date-time"></field>
-      <field name="thruDate" type="date-time"></field>
-      <prim-key field="configItemId"/>
-      <prim-key field="contentId"/>
-      <prim-key field="confItemContentTypeId"/>
-      <prim-key field="fromDate"/>
-      <relation type="one" fk-name="CIMT_CNT_PCIT" rel-entity-name="ProductConfigItem">
-        <key-map field-name="configItemId"/>
-      </relation>
-      <relation type="one" fk-name="CIMT_CNT_CNT" rel-entity-name="Content">
-        <key-map field-name="contentId"/>
-      </relation>
-      <relation type="one" fk-name="CIMT_CNT_TYPE" rel-entity-name="ProdConfItemContentType">
-        <key-map field-name="confItemContentTypeId"/>
-      </relation>
-    </entity>
-    <entity entity-name="ProdConfItemContentType"
-            package-name="org.ofbiz.product.product"
-            title="Product Content Type Entity">
-      <field name="confItemContentTypeId" type="id-ne"></field>
-      <field name="parentTypeId" type="id"></field>
-      <field name="hasTable" type="indicator"></field>
-      <field name="description" type="description"></field>
-      <prim-key field="confItemContentTypeId"/>
-      <relation type="one" fk-name="PCICT_TYP_PARENT" title="Parent" rel-entity-name="ProdConfItemContentType">
-        <key-map field-name="parentTypeId" rel-field-name="confItemContentTypeId"/>
-      </relation>
-    </entity>
-    <entity entity-name="ProductConfigOption"
-            package-name="org.ofbiz.product.config"
-            title="Product Configuration Options Entity">
-      <field name="configItemId" type="id-ne"></field>
-      <field name="configOptionId" type="id-ne"></field>
-      <field name="configOptionName" type="name"></field>
-      <field name="description" type="description"></field>
-      <field name="sequenceNum" type="numeric"></field>
-      <prim-key field="configItemId"/>
-      <prim-key field="configOptionId"/>
-      <relation type="one" fk-name="PROD_OPTN_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
-        <key-map field-name="configItemId"/>
-      </relation>
-    </entity>
-    <entity entity-name="ProductConfigOptionIactn"
-            package-name="org.ofbiz.product.config"
-            title="Product Configuration Options Entity">
-      <field name="configItemId" type="id-ne"></field>
-      <field name="configOptionId" type="id-ne"></field>
-      <field name="configItemIdTo" type="id-ne"></field>
-      <field name="configOptionIdTo" type="id-ne"></field>
-      <field name="sequenceNum" type="numeric"></field>
-      <field name="configIactnTypeId" type="id"></field> <!-- INCOMPATIBLE, etc... -->
-      <field name="description" type="description"></field>
-      <prim-key field="configItemId"/>
-      <prim-key field="configOptionId"/>
-      <prim-key field="configItemIdTo"/>
-      <prim-key field="configOptionIdTo"/>
-      <prim-key field="sequenceNum"/> <!-- OPTIONAL -->
-      <relation type="one" fk-name="PROD_OPTIA_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
-        <key-map field-name="configItemId"/>
-      </relation>
-      <relation type="one" fk-name="PROD_OPTIA_OPTN" title="ConfigOption" rel-entity-name="ProductConfigOption">
-        <key-map field-name="configItemId"/>
-        <key-map field-name="configOptionId"/>
-      </relation>
-      <relation type="one" fk-name="PROD_OPTIA_ITMT" title="ConfigItemTo" rel-entity-name="ProductConfigItem">
-        <key-map field-name="configItemIdTo" rel-field-name="configItemId"/>
-      </relation>
-      <relation type="one" fk-name="PROD_OPTIA_OPTT" title="ConfigOptionTo" rel-entity-name="ProductConfigOption">
-        <key-map field-name="configItemIdTo" rel-field-name="configItemId"/>
-        <key-map field-name="configOptionIdTo" rel-field-name="configOptionId"/>
-      </relation>
-    </entity>
-    <entity entity-name="ProductConfigProduct"
-            package-name="org.ofbiz.product.config"
-            title="Product Configuration Option to Products Entity">
-      <field name="configItemId" type="id-ne"></field>
-      <field name="configOptionId" type="id-ne"></field>
-      <field name="productId" type="id-ne"></field>
-      <field name="quantity" type="floating-point"></field>
-      <field name="sequenceNum" type="numeric"></field>
-      <prim-key field="configItemId"/>
-      <prim-key field="configOptionId"/>
-      <prim-key field="productId"/>
-      <relation type="one" fk-name="PROD_CONFP_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
-        <key-map field-name="configItemId"/>
-      </relation>
-      <relation type="one" fk-name="PROD_CONFP_OPTN" title="ConfigOption" rel-entity-name="ProductConfigOption">
-        <key-map field-name="configItemId"/>
-        <key-map field-name="configOptionId"/>
-      </relation>
-      <relation type="one" fk-name="PROD_CONFP_PROD" title="Product" rel-entity-name="Product">
-        <key-map field-name="productId"/>
-      </relation>
-    </entity>
-    <entity entity-name="ProductConfigConfig"
-            package-name="org.ofbiz.product.config"
-            title="Existing Product Configurations Entity">
-      <field name="configId" type="id-ne"></field>
-      <field name="configItemId" type="id-ne"></field>
-      <field name="sequenceNum" type="numeric"></field>
-      <field name="configOptionId" type="id-ne"></field>
-      <field name="description" type="description"></field>
-      <prim-key field="configId"/>
-      <prim-key field="configItemId"/>
-      <prim-key field="configOptionId"/>
-      <prim-key field="sequenceNum"/>
-      <relation type="one" fk-name="PROD_CONFC_ITEM" title="ConfigItem" rel-entity-name="ProductConfigItem">
-        <key-map field-name="configItemId"/>
-      </relation>
-      <relation type="one" fk-name="PROD_CONFC_OPTN" title="ConfigOption" rel-entity-name="ProductConfigOption">
-        <key-map field-name="configItemId"/>
-        <key-map field-name="configOptionId"/>
-      </relation>
-    </entity>
-    <entity entity-name="ProductConfigStats"
-            package-name="org.ofbiz.product.config"
-            title="Product Configurations Stats Entity">
-      <field name="configId" type="id-ne"></field>
-      <field name="productId" type="id-ne"></field>
-      <field name="numOfConfs" type="numeric"></field>
-      <field name="configTypeId" type="id"></field> <!-- HIDDEN, TEMPLATE, etc... -->
-      <prim-key field="configId"/>
-      <prim-key field="productId"/>
-      <relation type="one" fk-name="PROD_CONFS_PROD" title="Product" rel-entity-name="Product">
-        <key-map field-name="productId"/>
-      </relation>
-    </entity>
-
 </entitymodel>
-

Modified: trunk/applications/product/script/org/ofbiz/product/price/PriceServices.xml
===================================================================
--- trunk/applications/product/script/org/ofbiz/product/price/PriceServices.xml	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/product/script/org/ofbiz/product/price/PriceServices.xml	2005-09-03 12:26:24 UTC (rev 5638)
@@ -59,9 +59,7 @@
         <check-permission permission="CATALOG_PRICE_MAINT"><fail-property resource="ProductUiLabels" property="ProductPriceMaintPermissionError"/></check-permission>
         <check-errors/>
 
-        <make-value entity-name="ProductPrice" value-name="lookupPKMap"/>
-        <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
-        <find-by-primary-key entity-name="ProductPrice" map-name="lookupPKMap" value-name="lookedUpValue"/>
+        <entity-one entity-name="ProductPrice" value-name="lookedUpValue"/>
 
         <!-- grab the old price value before setting nonpk parameter fields -->
         <field-to-result map-name="lookedUpValue" field-name="price" result-name="oldPrice"/>
@@ -98,7 +96,7 @@
             <alt-permission permission="CATALOG_ROLE" action="_CREATE"/>
             <alt-permission permission="CATALOG_ROLE" action="_UPDATE"/>
             <alt-permission permission="CATALOG_ROLE" action="_DELETE"/>
-            <fail-message message="Security Error: to run saveProductPriceChange you must have the CATALOG_UPDATE or CATALOG_ADMIN permission"/>
+            <fail-message message="Security Error: to run saveProductPriceChange you must have a CATALOG_* or CATALOG_ROLE_* permission"/>
         </check-permission>
         <check-errors/>
 

Modified: trunk/applications/product/servicedef/services_pricepromo.xml
===================================================================
--- trunk/applications/product/servicedef/services_pricepromo.xml	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/product/servicedef/services_pricepromo.xml	2005-09-03 12:26:24 UTC (rev 5638)
@@ -39,12 +39,13 @@
         <attribute name="productStoreGroupId" type="String" mode="IN" optional="true"/>
         <attribute name="quantity" type="Double" mode="IN" optional="true"/>
         <attribute name="currencyUomId" type="String" mode="IN" optional="true"/>
+        <attribute name="productPricePurposeId" type="String" mode="IN" optional="true"><!-- defaults to PURCHASE --></attribute>
         <attribute name="autoUserLogin" type="GenericValue" mode="IN" optional="true"/>
+
         <attribute name="price" type="Double" mode="OUT" optional="false"/>
         <attribute name="listPrice" type="Double" mode="OUT" optional="true"/>
         <attribute name="defaultPrice" type="Double" mode="OUT" optional="true"/>
         <attribute name="competitivePrice" type="Double" mode="OUT" optional="true"/>
-        <attribute name="componentPrice" type="Double" mode="OUT" optional="true"/>
         <attribute name="averageCost" type="Double" mode="OUT" optional="true"/>
         <attribute name="promoPrice" type="Double" mode="OUT" optional="true"/>      
         <attribute name="isSale" type="Boolean" mode="OUT" optional="false"/>

Modified: trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java
===================================================================
--- trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java	2005-09-03 12:26:24 UTC (rev 5638)
@@ -401,9 +401,9 @@
                 GenericValue oneComponent = (GenericValue)componentsIt.next();
                 // Get the component's price
                 Map fieldMap = UtilMisc.toMap("product", oneComponent.getRelatedOne("ProductProduct"), "prodCatalogId", catalogId, "webSiteId", webSiteId,
-                                              "currencyUomId", currencyUomId, "autoUserLogin", autoUserLogin);
+                        "currencyUomId", currencyUomId, "productPricePurposeId", "COMPONENT_PRICE", "autoUserLogin", autoUserLogin);
                 Map priceMap = dispatcher.runSync("calculateProductPrice", fieldMap);
-                Double componentPrice = (Double)priceMap.get("componentPrice");
+                Double componentPrice = (Double) priceMap.get("price");
                 double mult = 1;
                 if (oneComponent.getDouble("quantity") != null) {
                     mult = oneComponent.getDouble("quantity").doubleValue();
@@ -414,7 +414,12 @@
                 if (componentPrice != null) {
                     price = componentPrice.doubleValue();
                 } else {
-                    price = ((Double)priceMap.get("price")).doubleValue();
+                    fieldMap.put("productPricePurposeId", "PURCHASE");
+                    Map purchasePriceResultMap = dispatcher.runSync("calculateProductPrice", fieldMap);
+                    Double purchasePrice = (Double) purchasePriceResultMap.get("price");
+                    if (purchasePrice != null) {
+                        price = purchasePrice.doubleValue();
+                    }
                 }
                 optionPrice += (price * mult);
                 // TODO: get the component's availability date

Modified: trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
===================================================================
--- trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java	2005-09-03 12:08:43 UTC (rev 5637)
+++ trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java	2005-09-03 12:26:24 UTC (rev 5638)
@@ -32,6 +32,8 @@
 import java.util.Map;
 import java.util.TreeSet;
 
+import javolution.util.FastList;
+
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilMisc;
@@ -40,6 +42,10 @@
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.condition.EntityConditionList;
+import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.product.product.ProductWorker;
 import org.ofbiz.service.DispatchContext;
@@ -117,12 +123,18 @@
             }
         }
 
-        // if currency uom is null get from properties file, if still null assume USD (USD: American Dollar) for now
+        // if currencyUomId is null get from properties file, if nothing there assume USD (USD: American Dollar) for now
         String currencyUomId = (String) context.get("currencyUomId");
         if (UtilValidate.isEmpty(currencyUomId)) {
             currencyUomId = UtilProperties.getPropertyValue("general", "currency.uom.id.default", "USD");
         }
 
+        // productPricePurposeId is null assume "PURCHASE", which is equivalent to what prices were before the purpose concept
+        String productPricePurposeId = (String) context.get("productPricePurposeId");
+        if (UtilValidate.isEmpty(productPricePurposeId)) {
+            productPricePurposeId = "PURCHASE";
+        }
+
         // if this product is variant, find the virtual product and apply checks to it as well
         String virtualProductId = null;
         if ("Y".equals(product.getString("isVariant"))) {
@@ -162,11 +174,26 @@
         Double quantityDbl = (Double) context.get("quantity");
         if (quantityDbl == null) quantityDbl = new Double(1.0);
         double quantity = quantityDbl.doubleValue();
+        
+        List productPriceEcList = FastList.newInstance();
+        productPriceEcList.add(new EntityExpr("productId", EntityOperator.EQUALS, productId));
+        // this funny statement is for backward compatibility purposes; the productPricePurposeId is a new pk field on the ProductPrice entity and in order databases may not be populated, until the pk is updated and such; this will ease the transition somewhat 
+        if ("PURCHASE".equals(productPricePurposeId)) {
+            productPriceEcList.add(new EntityExpr(
+                    new EntityExpr("productPricePurposeId", EntityOperator.EQUALS, productPricePurposeId), 
+                    EntityOperator.OR, 
+                    new EntityExpr("productPricePurposeId", EntityOperator.EQUALS, null)));
+        } else {
+            productPriceEcList.add(new EntityExpr("productPricePurposeId", EntityOperator.EQUALS, productPricePurposeId));
+        }
+        productPriceEcList.add(new EntityExpr("currencyUomId", EntityOperator.EQUALS, currencyUomId));
+        productPriceEcList.add(new EntityExpr("productStoreGroupId", EntityOperator.EQUALS, productStoreGroupId));
+        EntityCondition productPriceEc = new EntityConditionList(productPriceEcList, EntityOperator.AND);
 
         // for prices, get all ProductPrice entities for this productId and currencyUomId
         List productPrices = null;
         try {
-            productPrices = delegator.findByAndCache("ProductPrice", UtilMisc.toMap("productId", productId, "currencyUomId", currencyUomId, "productStoreGroupId", productStoreGroupId), UtilMisc.toList("-fromDate"));
+            productPrices = delegator.findByConditionCache("ProductPrice", productPriceEc, null, UtilMisc.toList("-fromDate"));
         } catch (GenericEntityException e) {
             Debug.logError(e, "An error occurred while getting the product prices", module);
         }
@@ -215,12 +242,6 @@
             if (Debug.infoOn()) Debug.logInfo("There is more than one MAXIMUM_PRICE with the currencyUomId " + currencyUomId + " and productId " + productId + ", using the latest found with price: " + maximumPriceValue.getDouble("price"), module);
         }
 
-        List componentPrices = EntityUtil.filterByAnd(productPrices, UtilMisc.toMap("productPriceTypeId", "COMPONENT_PRICE"));
-        GenericValue componentPriceValue = EntityUtil.getFirst(componentPrices);
-        if (componentPrices != null && componentPrices.size() > 1) {
-            if (Debug.infoOn()) Debug.logInfo("There is more than one COMPONENT_PRICE with the currencyUomId " + currencyUomId + " and productId " + productId + ", using the latest found with price: " + componentPriceValue.getDouble("price"), module);
-        }
-
         List wholesalePrices = EntityUtil.filterByAnd(productPrices, UtilMisc.toMap("productPriceTypeId", "WHOLESALE_PRICE"));
         GenericValue wholesalePriceValue = EntityUtil.getFirst(wholesalePrices);
         if (wholesalePrices != null && wholesalePrices.size() > 1) {
@@ -271,13 +292,6 @@
                     if (Debug.infoOn()) Debug.logInfo("There is more than one MAXIMUM_PRICE with the currencyUomId " + currencyUomId + " and productId " + virtualProductId + ", using the latest found with price: " + maximumPriceValue.getDouble("price"), module);
                 }
             }
-            if (componentPriceValue == null) {
-                List virtualTempPrices = EntityUtil.filterByAnd(virtualProductPrices, UtilMisc.toMap("productPriceTypeId", "COMPONENT_PRICE"));
-                componentPriceValue = EntityUtil.getFirst(virtualTempPrices);
-                if (virtualTempPrices != null && virtualTempPrices.size() > 1) {
-                    if (Debug.infoOn()) Debug.logInfo("There is more than one COMPONENT_PRICE with the currencyUomId " + currencyUomId + " and productId " + virtualProductId + ", using the latest found with price: " + componentPriceValue.getDouble("price"), module);
-                }
-            }
             if (wholesalePriceValue == null) {
                 List virtualTempPrices = EntityUtil.filterByAnd(virtualProductPrices, UtilMisc.toMap("productPriceTypeId", "WHOLESALE_PRICE"));
                 wholesalePriceValue = EntityUtil.getFirst(virtualTempPrices);
@@ -289,111 +303,104 @@
 
         // now if this is a virtual product check each price type, if doesn't exist get from variant with lowest DEFAULT_PRICE
         if ("Y".equals(product.getString("isVirtual"))) {
-            	// only do this if there is no default price, consider the others optional for performance reasons
-            	if (defaultPriceValue == null) {
-            		// Debug.logInfo("Product isVirtual and there is no default price for ID " + productId + ", trying variant prices", module);
+                // only do this if there is no default price, consider the others optional for performance reasons
+                if (defaultPriceValue == null) {
+                    // Debug.logInfo("Product isVirtual and there is no default price for ID " + productId + ", trying variant prices", module);
 
-            		//use the cache to find the variant with the lowest default price
-            		try {
-        	        		List variantAssocList = EntityUtil.filterByDate(delegator.findByAndCache("ProductAssoc", UtilMisc.toMap("productId", product.get("productId"), "productAssocTypeId", "PRODUCT_VARIANT"), UtilMisc.toList("-fromDate")));
-        	        		Iterator variantAssocIter = variantAssocList.iterator();
-        	        		double minDefaultPrice = Double.MAX_VALUE;
-        	        		List variantProductPrices = null;
-        	        		String variantProductId = null;
-        	        		while (variantAssocIter.hasNext()) {
-        	        			GenericValue variantAssoc = (GenericValue) variantAssocIter.next();
-        	        			String curVariantProductId = variantAssoc.getString("productIdTo");
-        	        			List curVariantPriceList = EntityUtil.filterByDate(delegator.findByAndCache("ProductPrice", UtilMisc.toMap("productId", curVariantProductId), UtilMisc.toList("-fromDate")), nowTimestamp);
-        	        			List tempDefaultPriceList = EntityUtil.filterByAnd(curVariantPriceList, UtilMisc.toMap("productPriceTypeId", "DEFAULT_PRICE"));
-        	        			GenericValue curDefaultPriceValue = EntityUtil.getFirst(tempDefaultPriceList);
-        	        			if (curDefaultPriceValue != null) {
-        	        				Double curDefaultPrice = curDefaultPriceValue.getDouble("price");
-        	        				if (curDefaultPrice.doubleValue() < minDefaultPrice) {
-        	        					// check to see if the product is discontinued for sale before considering it the lowest price
-        	        					GenericValue curVariantProduct = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", curVariantProductId));
-        	        					if (curVariantProduct != null) {
-        	        						Timestamp salesDiscontinuationDate = curVariantProduct.getTimestamp("salesDiscontinuationDate");
-        	        						if (salesDiscontinuationDate == null || salesDiscontinuationDate.after(nowTimestamp)) {
-        			        					minDefaultPrice = curDefaultPrice.doubleValue();
-        			        					variantProductPrices = curVariantPriceList;
-        			        					variantProductId = curVariantProductId;
-        			        					// Debug.logInfo("Found new lowest price " + minDefaultPrice + " for variant with ID " + variantProductId, module);
-        	        						}
-        	        					}
-        	        				}
-        	        			}
-        	        		}
+                    //use the cache to find the variant with the lowest default price
+                    try {
+                            List variantAssocList = EntityUtil.filterByDate(delegator.findByAndCache("ProductAssoc", UtilMisc.toMap("productId", product.get("productId"), "productAssocTypeId", "PRODUCT_VARIANT"), UtilMisc.toList("-fromDate")));
+                            Iterator variantAssocIter = variantAssocList.iterator();
+                            double minDefaultPrice = Double.MAX_VALUE;
+                            List variantProductPrices = null;
+                            String variantProductId = null;
+                            while (variantAssocIter.hasNext()) {
+                                GenericValue variantAssoc = (GenericValue) variantAssocIter.next();
+                                String curVariantProductId = variantAssoc.getString("productIdTo");
+                                List curVariantPriceList = EntityUtil.filterByDate(delegator.findByAndCache("ProductPrice", UtilMisc.toMap("productId", curVariantProductId), UtilMisc.toList("-fromDate")), nowTimestamp);
+                                List tempDefaultPriceList = EntityUtil.filterByAnd(curVariantPriceList, UtilMisc.toMap("productPriceTypeId", "DEFAULT_PRICE"));
+                                GenericValue curDefaultPriceValue = EntityUtil.getFirst(tempDefaultPriceList);
+                                if (curDefaultPriceValue != null) {
+                                    Double curDefaultPrice = curDefaultPriceValue.getDouble("price");
+                                    if (curDefaultPrice.doubleValue() < minDefaultPrice) {
+                                        // check to see if the product is discontinued for sale before considering it the lowest price
+                                        GenericValue curVariantProduct = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", curVariantProductId));
+                                        if (curVariantProduct != null) {
+                                            Timestamp salesDiscontinuationDate = curVariantProduct.getTimestamp("salesDiscontinuationDate");
+                                            if (salesDiscontinuationDate == null || salesDiscontinuationDate.after(nowTimestamp)) {
+                                                minDefaultPrice = curDefaultPrice.doubleValue();
+                                                variantProductPrices = curVariantPriceList;
+                                                variantProductId = curVariantProductId;
+                                                // Debug.logInfo("Found new lowest price " + minDefaultPrice + " for variant with ID " + variantProductId, module);
+                                            }
+                                        }
+                                    }
+                                }
+                            }
 
-        	        		if (variantProductPrices != null) {
-        	        			// we have some other options, give 'em a go...
-    	                    if (listPriceValue == null) {
-    	                        List virtualTempPrices = EntityUtil.filterByAnd(variantProductPrices, UtilMisc.toMap("productPriceTypeId", "LIST_PRICE"));
-    	                        listPriceValue = EntityUtil.getFirst(virtualTempPrices);
-    	                        if (virtualTempPrices != null && virtualTempPrices.size() > 1) {
-    	                            if (Debug.infoOn()) Debug.logInfo("There is more than one LIST_PRICE with the currencyUomId " + currencyUomId + " and productId " + variantProductId + ", using the latest found with price: " + listPriceValue.getDouble("price"), module);
-    	                        }
-    	                    }
-    	                    if (defaultPriceValue == null) {
-    	                        List virtualTempPrices = EntityUtil.filterByAnd(variantProductPrices, UtilMisc.toMap("productPriceTypeId", "DEFAULT_PRICE"));
-    	                        defaultPriceValue = EntityUtil.getFirst(virtualTempPrices);
-    	                        if (virtualTempPrices != null && virtualTempPrices.size() > 1) {
-    	                            if (Debug.infoOn()) Debug.logInfo("There is more than one DEFAULT_PRICE with the currencyUomId " + currencyUomId + " and productId " + variantProductId + ", using the latest found with price: " + defaultPriceValue.getDouble("price"), module);
-    	                        }
-    	                    }
-    	                    if (competitivePriceValue == null) {
-    	                        List virtualTempPrices = EntityUtil.filterByAnd(variantProductPrices, UtilMisc.toMap("productPriceTypeId", "COMPETITIVE_PRICE"));
-    	                        competitivePriceValue = EntityUtil.getFirst(virtualTempPrices);
-    	                        if (virtualTempPrices != null && virtualTempPrices.size() > 1) {
-    	                            if (Debug.infoOn()) Debug.logInfo("There is more than one COMPETITIVE_PRICE with the currencyUomId " + currencyUomId + " and productId " + variantProductId + ", using the latest found with price: " + competitivePriceValue.getDouble("price"), module);
-    	                        }
-    	                    }
-    	                    if (averageCostValue == null) {
-    	                        List virtualTempPrices = EntityUtil.filterByAnd(variantProductPrices, UtilMisc.toMap("productPriceTypeId", "AVERAGE_COST"));
-    	                        averageCostValue = EntityUtil.getFirst(virtualTempPrices);
-    	                        if (virtualTempPrices != null && virtualTempPrices.size() > 1) {
-    	                            if (Debug.infoOn()) Debug.logInfo("There is more than one AVERAGE_COST with the currencyUomId " + currencyUomId + " and productId " + variantProductId + ", using the latest found with price: " + averageCostValue.getDouble("price"), module);
-    	                        }
-    	                    }
-    	                    if (promoPriceValue == null) {
-    	                        List virtualTempPrices = EntityUtil.filterByAnd(variantProductPrices, UtilMisc.toMap("productPriceTypeId", "PROMO_PRICE"));
-    	                        promoPriceValue = EntityUtil.getFirst(virtualTempPrices);
-    	                        if (virtualTempPrices != null && virtualTempPrices.size() > 1) {
-    	                            if (Debug.infoOn()) Debug.logInfo("There is more than one PROMO_PRICE with the currencyUomId " + currencyUomId + " and productId " + variantProductId + ", using the latest found with price: " + promoPriceValue.getDouble("price"), module);
-    	                        }
-    	                    }
-    	                    if (minimumPriceValue == null) {
-    	                        List virtualTempPrices = EntityUtil.filterByAnd(variantProductPrices, UtilMisc.toMap("productPriceTypeId", "MINIMUM_PRICE"));
-    	                        minimumPriceValue = EntityUtil.getFirst(virtualTempPrices);
-    	                        if (virtualTempPrices != null && virtualTempPrices.size() > 1) {
-    	                            if (Debug.infoOn()) Debug.logInfo("There is more than one MINIMUM_PRICE with the currencyUomId " +