Fixes issue 7184, Database model validation should only log errors not stop dal-initialize process
authorMartin Taal <martin.taal@openbravo.com>
Wed, 28 Jan 2009 14:17:33 +0000
changeset 2771 3c2361b78745
parent 2770 92dddb0a66ef
child 2772 769c172f046f
Fixes issue 7184, Database model validation should only log errors not stop dal-initialize process
Added missing foreign key constraints
Updated sample data, the identifier definition was apparently updated
referencedata/sampledata/Accounting_Test.xml
referencedata/sampledata/BigBazaar.xml
src-db/database/model/tables/AD_DATASET.xml
src-db/database/model/tables/AD_HEARTBEAT_LOG.xml
src-db/database/model/tables/AD_MODULE_LOG.xml
src-db/database/model/tables/AD_ORGMODULE.xml
src-db/database/model/tables/AD_ORG_CLOSING.xml
src-db/database/model/tables/AD_PROCESS_REQUEST.xml
src-db/database/model/tables/AD_PROCESS_RUN.xml
src-db/database/model/tables/AD_REF_DATA_LOADED.xml
src-db/database/model/tables/AD_REF_LIST.xml
src-db/database/model/tables/AD_REF_SEARCH.xml
src-db/database/model/tables/AD_REGISTRATION_INFO.xml
src-db/database/model/tables/AD_SYSTEM_INFO.xml
src-db/database/model/tables/AD_TABLE.xml
src-db/database/model/tables/AD_WINDOW.xml
src-db/database/model/tables/C_ACCTSCHEMA_GL.xml
src-db/database/model/tables/C_ACCTSCHEMA_TABLE_DOCTYPE.xml
src-db/database/model/tables/C_ACCT_RPT.xml
src-db/database/model/tables/C_ACCT_RPT_NODE.xml
src-db/database/model/tables/C_BANKSTATEMENTLINE.xml
src-db/database/model/tables/C_BPARTNER.xml
src-db/database/model/tables/C_BP_BANKACCOUNT.xml
src-db/database/model/tables/C_BP_SALCATEGORY.xml
src-db/database/model/tables/C_CASHLINE.xml
src-db/database/model/tables/C_COMMISSIONLINE.xml
src-db/database/model/tables/C_DEBT_PAYMENT.xml
src-db/database/model/tables/C_DOCTYPE.xml
src-db/database/model/tables/C_INVOICE.xml
src-db/database/model/tables/C_ORDER.xml
src-db/database/model/tables/C_POC_EMAILDEFINITION.xml
src-db/database/model/tables/C_REMITTANCELINE.xml
src-db/database/model/tables/C_SALESREGION.xml
src-db/database/model/tables/C_TAXREGISTERLINE.xml
src-db/database/model/tables/FACT_ACCT_CFS.xml
src-db/database/model/tables/M_INOUT.xml
src-db/database/model/tables/M_PRODUCT.xml
src-db/database/model/tables/M_PRODUCT_ORG.xml
src-db/database/model/tables/M_REQUISITIONLINE.xml
src-test/org/openbravo/test/system/SystemValidatorTest.java
src/org/openbravo/base/model/Property.java
src/org/openbravo/service/system/DatabaseValidator.java
src/org/openbravo/service/system/ModuleValidator.java
src/org/openbravo/service/system/SystemValidationResult.java
src/org/openbravo/service/system/SystemValidationTask.java
--- a/referencedata/sampledata/Accounting_Test.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/referencedata/sampledata/Accounting_Test.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -26080,7 +26080,7 @@
     <isActive>true</isActive>
     <id>1000047</id>
   </MaterialMgmtStorageDetail>
-  <MaterialMgmtStoragePending id="1000020" identifier="MaterialMgmtStoragePending (1000020)">
+  <MaterialMgmtStoragePending id="1000020" identifier="Standard Standard  0 0">
     <product id="1000064" entity-name="Product" identifier="Standard"/>
     <warehouse id="1000002" entity-name="Warehouse" identifier="Standard"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -26095,7 +26095,7 @@
     <isActive>true</isActive>
     <id>1000020</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtCosting id="1000089" identifier="MaterialMgmtCosting (1000089)">
+  <MaterialMgmtCosting id="1000089" identifier="Standard 2000-01-01 00:00:00.0">
     <id>1000089</id>
     <client id="1000001" entity-name="ADClient" identifier="Accounting Test"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -26114,7 +26114,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <FinancialMgmtAssetGroupAcct id="52118BF1B0634D84E040007F01005FEC" identifier="FinancialMgmtAssetGroupAcct (52118BF1B0634D84E040007F01005FEC)">
+  <FinancialMgmtAssetGroupAcct id="52118BF1B0634D84E040007F01005FEC" identifier="Standard Accounting Test US/A/US Dollar">
     <id>52118BF1B0634D84E040007F01005FEC</id>
     <assetGroup id="1000004" entity-name="FinancialMgmtAssetGroup" identifier="Standard"/>
     <accountSchema id="1000001" entity-name="FinancialMgmtAcctSchema" identifier="Accounting Test US/A/US Dollar"/>
@@ -26190,7 +26190,7 @@
     <description/>
     <line>20.0</line>
   </FinancialMgmtAcctRptGroup>
-  <OrganizationAcctSchema id="5AEDC6F79ADDDDC0E040007F010138DD" identifier="OrganizationAcctSchema (5AEDC6F79ADDDDC0E040007F010138DD)">
+  <OrganizationAcctSchema id="5AEDC6F79ADDDDC0E040007F010138DD" identifier="Accounting Test Org Accounting Test US/A/US Dollar">
     <id>5AEDC6F79ADDDDC0E040007F010138DD</id>
     <client id="1000001" entity-name="ADClient" identifier="Accounting Test"/>
     <organization id="1000001" entity-name="Organization" identifier="Accounting Test Org"/>
--- a/referencedata/sampledata/BigBazaar.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/referencedata/sampledata/BigBazaar.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -129446,7 +129446,7 @@
     <isActive>true</isActive>
     <id>1000046</id>
   </MaterialMgmtStorageDetail>
-  <MaterialMgmtStoragePending id="1000000" identifier="MaterialMgmtStoragePending (1000000)">
+  <MaterialMgmtStoragePending id="1000000" identifier="Paint Main Warehouse  0 700">
     <product id="1000000" entity-name="Product" identifier="Paint"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129461,7 +129461,7 @@
     <isActive>true</isActive>
     <id>1000000</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000001" identifier="MaterialMgmtStoragePending (1000001)">
+  <MaterialMgmtStoragePending id="1000001" identifier="Shirts Main Warehouse  0 2">
     <product id="1000004" entity-name="Product" identifier="Shirts"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129476,7 +129476,7 @@
     <isActive>true</isActive>
     <id>1000001</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000002" identifier="MaterialMgmtStoragePending (1000002)">
+  <MaterialMgmtStoragePending id="1000002" identifier="Boots Main Warehouse  0 0">
     <product id="1000005" entity-name="Product" identifier="Boots"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129491,7 +129491,7 @@
     <isActive>true</isActive>
     <id>1000002</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000003" identifier="MaterialMgmtStoragePending (1000003)">
+  <MaterialMgmtStoragePending id="1000003" identifier="Food kit Main Warehouse  0 0">
     <product id="1000011" entity-name="Product" identifier="Food kit"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129506,7 +129506,7 @@
     <isActive>true</isActive>
     <id>1000003</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000004" identifier="MaterialMgmtStoragePending (1000004)">
+  <MaterialMgmtStoragePending id="1000004" identifier="Stone Slab Main Warehouse  0 0">
     <product id="1000015" entity-name="Product" identifier="Stone Slab"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129521,7 +129521,7 @@
     <isActive>true</isActive>
     <id>1000004</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000005" identifier="MaterialMgmtStoragePending (1000005)">
+  <MaterialMgmtStoragePending id="1000005" identifier="Boots Main Warehouse  0 0">
     <product id="1000005" entity-name="Product" identifier="Boots"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="1000006" entity-name="AttributeSetInstance" identifier=""/>
@@ -129536,7 +129536,7 @@
     <isActive>true</isActive>
     <id>1000005</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000006" identifier="MaterialMgmtStoragePending (1000006)">
+  <MaterialMgmtStoragePending id="1000006" identifier="Boots Main Warehouse  0 0">
     <product id="1000005" entity-name="Product" identifier="Boots"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="1000008" entity-name="AttributeSetInstance" identifier=""/>
@@ -129551,7 +129551,7 @@
     <isActive>true</isActive>
     <id>1000006</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000007" identifier="MaterialMgmtStoragePending (1000007)">
+  <MaterialMgmtStoragePending id="1000007" identifier="Donuts Main Warehouse  47 0">
     <product id="1000007" entity-name="Product" identifier="Donuts"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129566,7 +129566,7 @@
     <isActive>true</isActive>
     <id>1000007</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000008" identifier="MaterialMgmtStoragePending (1000008)">
+  <MaterialMgmtStoragePending id="1000008" identifier="Hat Main Warehouse  0 1">
     <product id="1000006" entity-name="Product" identifier="Hat"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129581,7 +129581,7 @@
     <isActive>true</isActive>
     <id>1000008</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000009" identifier="MaterialMgmtStoragePending (1000009)">
+  <MaterialMgmtStoragePending id="1000009" identifier="Wooden Back Main Warehouse  0 0">
     <product id="1000017" entity-name="Product" identifier="Wooden Back"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129596,7 +129596,7 @@
     <isActive>true</isActive>
     <id>1000009</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000010" identifier="MaterialMgmtStoragePending (1000010)">
+  <MaterialMgmtStoragePending id="1000010" identifier="Wood slice Main Warehouse  0 0">
     <product id="1000018" entity-name="Product" identifier="Wood slice"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129611,7 +129611,7 @@
     <isActive>true</isActive>
     <id>1000010</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000011" identifier="MaterialMgmtStoragePending (1000011)">
+  <MaterialMgmtStoragePending id="1000011" identifier="Paint Main Warehouse Rosa 0 0">
     <product id="1000000" entity-name="Product" identifier="Paint"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="1000003" entity-name="AttributeSetInstance" identifier="Rosa"/>
@@ -129626,7 +129626,7 @@
     <isActive>true</isActive>
     <id>1000011</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000012" identifier="MaterialMgmtStoragePending (1000012)">
+  <MaterialMgmtStoragePending id="1000012" identifier="Paint Main Warehouse Verde 0 0">
     <product id="1000000" entity-name="Product" identifier="Paint"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="1000009" entity-name="AttributeSetInstance" identifier="Verde"/>
@@ -129641,7 +129641,7 @@
     <isActive>true</isActive>
     <id>1000012</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000013" identifier="MaterialMgmtStoragePending (1000013)">
+  <MaterialMgmtStoragePending id="1000013" identifier="Hammer Main Warehouse  11 1">
     <product id="1000009" entity-name="Product" identifier="Hammer"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129656,7 +129656,7 @@
     <isActive>true</isActive>
     <id>1000013</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000014" identifier="MaterialMgmtStoragePending (1000014)">
+  <MaterialMgmtStoragePending id="1000014" identifier="Screwdriver Main Warehouse  11 0">
     <product id="1000010" entity-name="Product" identifier="Screwdriver"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129671,7 +129671,7 @@
     <isActive>true</isActive>
     <id>1000014</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000015" identifier="MaterialMgmtStoragePending (1000015)">
+  <MaterialMgmtStoragePending id="1000015" identifier="Grand beer Main Warehouse  50 0">
     <product id="1000008" entity-name="Product" identifier="Grand beer"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129686,7 +129686,7 @@
     <isActive>true</isActive>
     <id>1000015</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000016" identifier="MaterialMgmtStoragePending (1000016)">
+  <MaterialMgmtStoragePending id="1000016" identifier="Shirts Main Warehouse Media 0 0">
     <product id="1000004" entity-name="Product" identifier="Shirts"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="1000000" entity-name="AttributeSetInstance" identifier="Media"/>
@@ -129701,7 +129701,7 @@
     <isActive>true</isActive>
     <id>1000016</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000017" identifier="MaterialMgmtStoragePending (1000017)">
+  <MaterialMgmtStoragePending id="1000017" identifier="Boots Main Warehouse Grande 1 0">
     <product id="1000005" entity-name="Product" identifier="Boots"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="1000010" entity-name="AttributeSetInstance" identifier="Grande"/>
@@ -129716,7 +129716,7 @@
     <isActive>true</isActive>
     <id>1000017</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000018" identifier="MaterialMgmtStoragePending (1000018)">
+  <MaterialMgmtStoragePending id="1000018" identifier="Marble Main Warehouse  0 0">
     <product id="1000028" entity-name="Product" identifier="Marble"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129731,7 +129731,7 @@
     <isActive>true</isActive>
     <id>1000018</id>
   </MaterialMgmtStoragePending>
-  <MaterialMgmtStoragePending id="1000019" identifier="MaterialMgmtStoragePending (1000019)">
+  <MaterialMgmtStoragePending id="1000019" identifier="Block of Wood Main Warehouse  0 -30">
     <product id="1000022" entity-name="Product" identifier="Block of Wood"/>
     <warehouse id="1000000" entity-name="Warehouse" identifier="Main Warehouse"/>
     <attributeSetInstance id="0" entity-name="AttributeSetInstance" identifier=""/>
@@ -129758,7 +129758,7 @@
     <timeTo/>
     <isFullTime>true</isFullTime>
   </ADProcessScheduling>
-  <MaterialMgmtCosting id="1000078" identifier="MaterialMgmtCosting (1000078)">
+  <MaterialMgmtCosting id="1000078" identifier="Paint 2006-04-03 00:00:00.0">
     <id>1000078</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129777,7 +129777,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000079" identifier="MaterialMgmtCosting (1000079)">
+  <MaterialMgmtCosting id="1000079" identifier="Paint 2006-04-12 00:00:00.0">
     <id>1000079</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129796,7 +129796,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000080" identifier="MaterialMgmtCosting (1000080)">
+  <MaterialMgmtCosting id="1000080" identifier="Shirts 2006-03-31 00:00:00.0">
     <id>1000080</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129815,7 +129815,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000081" identifier="MaterialMgmtCosting (1000081)">
+  <MaterialMgmtCosting id="1000081" identifier="Boots 2006-03-31 00:00:00.0">
     <id>1000081</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129834,7 +129834,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000082" identifier="MaterialMgmtCosting (1000082)">
+  <MaterialMgmtCosting id="1000082" identifier="Donuts 2006-08-07 00:00:00.0">
     <id>1000082</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129853,7 +129853,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000083" identifier="MaterialMgmtCosting (1000083)">
+  <MaterialMgmtCosting id="1000083" identifier="Grand beer 2006-08-07 00:00:00.0">
     <id>1000083</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129872,7 +129872,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000084" identifier="MaterialMgmtCosting (1000084)">
+  <MaterialMgmtCosting id="1000084" identifier="Hammer 2006-03-31 00:00:00.0">
     <id>1000084</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129891,7 +129891,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000085" identifier="MaterialMgmtCosting (1000085)">
+  <MaterialMgmtCosting id="1000085" identifier="Screwdriver 2006-03-31 00:00:00.0">
     <id>1000085</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129910,7 +129910,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000086" identifier="MaterialMgmtCosting (1000086)">
+  <MaterialMgmtCosting id="1000086" identifier="Stone Slab 2006-03-29 00:00:00.0">
     <id>1000086</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129929,7 +129929,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000087" identifier="MaterialMgmtCosting (1000087)">
+  <MaterialMgmtCosting id="1000087" identifier="Block of Wood 2006-04-12 00:00:00.0">
     <id>1000087</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -129948,7 +129948,7 @@
     <productionLine/>
     <isproduction>false</isproduction>
   </MaterialMgmtCosting>
-  <MaterialMgmtCosting id="1000088" identifier="MaterialMgmtCosting (1000088)">
+  <MaterialMgmtCosting id="1000088" identifier="Marble 2006-04-12 00:00:00.0">
     <id>1000088</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -130316,7 +130316,7 @@
     <section id="1000001" entity-name="ManufacturingSection" identifier="Main floor"/>
     <value>10000000</value>
   </ManufacturingWorkCenter>
-  <ManufacturingMachineStation id="1000003" identifier="ManufacturingMachineStation (1000003)">
+  <ManufacturingMachineStation id="1000003" identifier="Wood saw 10000000 Badge station">
     <id>1000003</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -130324,7 +130324,7 @@
     <machine id="1000003" entity-name="ManufacturingMachine" identifier="Wood saw 10000000"/>
     <workCenter id="1000001" entity-name="ManufacturingWorkCenter" identifier="Badge station"/>
   </ManufacturingMachineStation>
-  <ManufacturingMachineStation id="1000004" identifier="ManufacturingMachineStation (1000004)">
+  <ManufacturingMachineStation id="1000004" identifier="Wood router 10000001 Badge station">
     <id>1000004</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -130332,7 +130332,7 @@
     <machine id="1000004" entity-name="ManufacturingMachine" identifier="Wood router 10000001"/>
     <workCenter id="1000001" entity-name="ManufacturingWorkCenter" identifier="Badge station"/>
   </ManufacturingMachineStation>
-  <ManufacturingMachineStation id="1000005" identifier="ManufacturingMachineStation (1000005)">
+  <ManufacturingMachineStation id="1000005" identifier="Paint gun 10000003 Badge station">
     <id>1000005</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -130340,7 +130340,7 @@
     <machine id="1000006" entity-name="ManufacturingMachine" identifier="Paint gun 10000003"/>
     <workCenter id="1000001" entity-name="ManufacturingWorkCenter" identifier="Badge station"/>
   </ManufacturingMachineStation>
-  <ManufacturingMachineStation id="1000006" identifier="ManufacturingMachineStation (1000006)">
+  <ManufacturingMachineStation id="1000006" identifier="Stone Saw 10000002 Badge station">
     <id>1000006</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -130554,7 +130554,7 @@
     <machine/>
     <explode>false</explode>
   </ManufacturingMaintenance>
-  <ManufacturingMaintenancePeriodicity id="1000000" identifier="ManufacturingMaintenancePeriodicity (1000000)">
+  <ManufacturingMaintenancePeriodicity id="1000000" identifier="M1 Regular Oil Change">
     <id>1000000</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -130567,7 +130567,7 @@
     <initdate/>
     <excludeweekend>true</excludeweekend>
   </ManufacturingMaintenancePeriodicity>
-  <ManufacturingMaintenancePeriodicity id="1000001" identifier="ManufacturingMaintenancePeriodicity (1000001)">
+  <ManufacturingMaintenancePeriodicity id="1000001" identifier="M2 Regular Blade Check">
     <id>1000001</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -130580,7 +130580,7 @@
     <initdate/>
     <excludeweekend>true</excludeweekend>
   </ManufacturingMaintenancePeriodicity>
-  <ManufacturingMaintenancePeriodicity id="1000002" identifier="ManufacturingMaintenancePeriodicity (1000002)">
+  <ManufacturingMaintenancePeriodicity id="1000002" identifier="M1 Regular Oil change">
     <id>1000002</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -130593,7 +130593,7 @@
     <initdate/>
     <excludeweekend>true</excludeweekend>
   </ManufacturingMaintenancePeriodicity>
-  <ManufacturingMaintenancePeriodicity id="1000003" identifier="ManufacturingMaintenancePeriodicity (1000003)">
+  <ManufacturingMaintenancePeriodicity id="1000003" identifier="M2 Regular Blade Check">
     <id>1000003</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -130606,7 +130606,7 @@
     <initdate/>
     <excludeweekend>true</excludeweekend>
   </ManufacturingMaintenancePeriodicity>
-  <FinancialMgmtAssetGroupAcct id="52118BF1B0604D84E040007F01005FEC" identifier="FinancialMgmtAssetGroupAcct (52118BF1B0604D84E040007F01005FEC)">
+  <FinancialMgmtAssetGroupAcct id="52118BF1B0604D84E040007F01005FEC" identifier="Material BigBazaar US/A/Euro">
     <id>52118BF1B0604D84E040007F01005FEC</id>
     <assetGroup id="1000000" entity-name="FinancialMgmtAssetGroup" identifier="Material"/>
     <accountSchema id="1000000" entity-name="FinancialMgmtAcctSchema" identifier="BigBazaar US/A/Euro"/>
@@ -130619,7 +130619,7 @@
     <disposalGain id="1000069" entity-name="FinancialMgmtAccountingCombination" identifier="Main-77100-_-_-_"/>
     <processing>false</processing>
   </FinancialMgmtAssetGroupAcct>
-  <FinancialMgmtAssetGroupAcct id="52118BF1B0614D84E040007F01005FEC" identifier="FinancialMgmtAssetGroupAcct (52118BF1B0614D84E040007F01005FEC)">
+  <FinancialMgmtAssetGroupAcct id="52118BF1B0614D84E040007F01005FEC" identifier="Vehicles BigBazaar US/A/Euro">
     <id>52118BF1B0614D84E040007F01005FEC</id>
     <assetGroup id="1000002" entity-name="FinancialMgmtAssetGroup" identifier="Vehicles"/>
     <accountSchema id="1000000" entity-name="FinancialMgmtAcctSchema" identifier="BigBazaar US/A/Euro"/>
@@ -130632,7 +130632,7 @@
     <disposalGain id="1000069" entity-name="FinancialMgmtAccountingCombination" identifier="Main-77100-_-_-_"/>
     <processing>false</processing>
   </FinancialMgmtAssetGroupAcct>
-  <FinancialMgmtAssetGroupAcct id="52118BF1B0624D84E040007F01005FEC" identifier="FinancialMgmtAssetGroupAcct (52118BF1B0624D84E040007F01005FEC)">
+  <FinancialMgmtAssetGroupAcct id="52118BF1B0624D84E040007F01005FEC" identifier="Machinery BigBazaar US/A/Euro">
     <id>52118BF1B0624D84E040007F01005FEC</id>
     <assetGroup id="1000003" entity-name="FinancialMgmtAssetGroup" identifier="Machinery"/>
     <accountSchema id="1000000" entity-name="FinancialMgmtAcctSchema" identifier="BigBazaar US/A/Euro"/>
@@ -131134,7 +131134,7 @@
     <processed>Y</processed>
     <processing>false</processing>
   </FinancialMgmtRemittance>
-  <FinancialMgmtRemittanceLine id="1000006" identifier="FinancialMgmtRemittanceLine (1000006)">
+  <FinancialMgmtRemittanceLine id="1000006" identifier="Prueba 10000000 11">
     <id>1000006</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131145,7 +131145,7 @@
     <debtPaymentCancelled id="10000038" entity-name="FinancialMgmtDebtPayment" identifier="true Sailor Inc P -3233.49 2006-03-29 00:00:00.0"/>
     <returned>false</returned>
   </FinancialMgmtRemittanceLine>
-  <FinancialMgmtRemittanceLine id="1000007" identifier="FinancialMgmtRemittanceLine (1000007)">
+  <FinancialMgmtRemittanceLine id="1000007" identifier="Prueba 10000001 11">
     <id>1000007</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131156,7 +131156,7 @@
     <debtPaymentCancelled id="10000035" entity-name="FinancialMgmtDebtPayment" identifier="true The Simpsons Ltd 3 -354.96 2006-04-18 00:00:00.0"/>
     <returned>false</returned>
   </FinancialMgmtRemittanceLine>
-  <FinancialMgmtRemittanceLine id="1000008" identifier="FinancialMgmtRemittanceLine (1000008)">
+  <FinancialMgmtRemittanceLine id="1000008" identifier="Prueba 10000001 21">
     <id>1000008</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131167,7 +131167,7 @@
     <debtPaymentCancelled id="10000036" entity-name="FinancialMgmtDebtPayment" identifier="true The Simpsons Ltd 3 -606.0 2006-04-18 00:00:00.0"/>
     <returned>true</returned>
   </FinancialMgmtRemittanceLine>
-  <FinancialMgmtRemittanceLine id="1000019" identifier="FinancialMgmtRemittanceLine (1000019)">
+  <FinancialMgmtRemittanceLine id="1000019" identifier="Prueba2 10000002 11">
     <id>1000019</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131178,7 +131178,7 @@
     <debtPaymentCancelled/>
     <returned>false</returned>
   </FinancialMgmtRemittanceLine>
-  <FinancialMgmtRemittanceLine id="1000020" identifier="FinancialMgmtRemittanceLine (1000020)">
+  <FinancialMgmtRemittanceLine id="1000020" identifier="Prueba2 10000002 21">
     <id>1000020</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131189,7 +131189,7 @@
     <debtPaymentCancelled/>
     <returned>false</returned>
   </FinancialMgmtRemittanceLine>
-  <FinancialMgmtRemittanceLine id="1000026" identifier="FinancialMgmtRemittanceLine (1000026)">
+  <FinancialMgmtRemittanceLine id="1000026" identifier="Remesa de prueba 10000003 11">
     <id>1000026</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131200,7 +131200,7 @@
     <debtPaymentCancelled id="10000042" entity-name="FinancialMgmtDebtPayment" identifier="true The Ford Painter Company P -108.73 2006-10-19 00:00:00.0"/>
     <returned>true</returned>
   </FinancialMgmtRemittanceLine>
-  <FinancialMgmtRemittanceLine id="1000027" identifier="FinancialMgmtRemittanceLine (1000027)">
+  <FinancialMgmtRemittanceLine id="1000027" identifier="Remesa de prueba 10000003 21">
     <id>1000027</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131211,7 +131211,7 @@
     <debtPaymentCancelled id="10000043" entity-name="FinancialMgmtDebtPayment" identifier="false Edison Energy Company P -3500.0 2006-10-19 00:00:00.0"/>
     <returned>false</returned>
   </FinancialMgmtRemittanceLine>
-  <FinancialMgmtRemittanceLine id="1000071" identifier="FinancialMgmtRemittanceLine (1000071)">
+  <FinancialMgmtRemittanceLine id="1000071" identifier="xxx 10000006 11">
     <id>1000071</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131222,7 +131222,7 @@
     <debtPaymentCancelled id="19000111" entity-name="FinancialMgmtDebtPayment" identifier="true The Ford Painter Company 5 -1000.0 2006-05-01 00:00:00.0"/>
     <returned>false</returned>
   </FinancialMgmtRemittanceLine>
-  <FinancialMgmtRemittanceLine id="1000072" identifier="FinancialMgmtRemittanceLine (1000072)">
+  <FinancialMgmtRemittanceLine id="1000072" identifier="xxx 10000006 21">
     <id>1000072</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131287,7 +131287,7 @@
     <isActive>true</isActive>
     <iscostapplied>true</iscostapplied>
   </SalaryCategory>
-  <SalaryCategoryCost id="1000000" identifier="SalaryCategoryCost (1000000)">
+  <SalaryCategoryCost id="1000000" identifier="Production Worker 2001-02-01 00:00:00.0 10.0 H">
     <id>1000000</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131296,7 +131296,7 @@
     <cost>10.0</cost>
     <costuom>H</costuom>
   </SalaryCategoryCost>
-  <SalaryCategoryCost id="1000001" identifier="SalaryCategoryCost (1000001)">
+  <SalaryCategoryCost id="1000001" identifier="Production Manager 2007-03-01 00:00:00.0 10.0 H">
     <id>1000001</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131305,7 +131305,7 @@
     <cost>10.0</cost>
     <costuom>H</costuom>
   </SalaryCategoryCost>
-  <ManufacturingCostcenterEmployee id="1000006" identifier="ManufacturingCostcenterEmployee (1000006)">
+  <ManufacturingCostcenterEmployee id="1000006" identifier="10000006 ManufacturingCostCenter(1000006) (name: Wood saw) 2007-01-01 00:00:00.0 Production Worker">
     <id>1000006</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131315,7 +131315,7 @@
     <costuom>H</costuom>
     <isActive>true</isActive>
   </ManufacturingCostcenterEmployee>
-  <ManufacturingCostcenterEmployee id="1000007" identifier="ManufacturingCostcenterEmployee (1000007)">
+  <ManufacturingCostcenterEmployee id="1000007" identifier="10000007 ManufacturingCostCenter(1000007) (name: Wood router) 2007-01-01 00:00:00.0 Production Worker">
     <id>1000007</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131325,7 +131325,7 @@
     <costuom>H</costuom>
     <isActive>true</isActive>
   </ManufacturingCostcenterEmployee>
-  <ManufacturingCostcenterEmployee id="1000008" identifier="ManufacturingCostcenterEmployee (1000008)">
+  <ManufacturingCostcenterEmployee id="1000008" identifier="10000008 ManufacturingCostCenter(1000008) (name: Stone Saw) 2007-01-01 00:00:00.0 Production Worker">
     <id>1000008</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131335,7 +131335,7 @@
     <costuom>H</costuom>
     <isActive>true</isActive>
   </ManufacturingCostcenterEmployee>
-  <ManufacturingCostcenterEmployee id="1000009" identifier="ManufacturingCostcenterEmployee (1000009)">
+  <ManufacturingCostcenterEmployee id="1000009" identifier="10000009 ManufacturingCostCenter(1000009) (name: Paint gun) 2007-01-01 00:00:00.0 Production Worker">
     <id>1000009</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131345,7 +131345,7 @@
     <costuom>H</costuom>
     <isActive>true</isActive>
   </ManufacturingCostcenterEmployee>
-  <ManufacturingCostcenterEmployee id="1000010" identifier="ManufacturingCostcenterEmployee (1000010)">
+  <ManufacturingCostcenterEmployee id="1000010" identifier="10000010 ManufacturingCostCenter(1000010) (name: Assembly) 2007-01-01 00:00:00.0 Production Worker">
     <id>1000010</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131373,7 +131373,7 @@
     <description>Marketingthe product</description>
     <costType>S</costType>
   </ManufacturingIndirectCost>
-  <ManufacturingIndirectCostValue id="1000002" identifier="ManufacturingIndirectCostValue (1000002)">
+  <ManufacturingIndirectCostValue id="1000002" identifier="Marketing 2007-01-01 00:00:00.0 2020-01-01 00:00:00.0 0.1">
     <id>1000002</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131387,7 +131387,7 @@
     <costUom>U</costUom>
     <calculated>false</calculated>
   </ManufacturingIndirectCostValue>
-  <ManufacturingIndirectCostValue id="1000003" identifier="ManufacturingIndirectCostValue (1000003)">
+  <ManufacturingIndirectCostValue id="1000003" identifier="Cleaning 2007-01-01 00:00:00.0 2020-01-01 00:00:00.0 20.0">
     <id>1000003</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131456,7 +131456,7 @@
     <costuom>U</costuom>
     <validFrom>2007-01-01T00:00:00.0Z</validFrom>
   </ManufacturingCostcenterVersion>
-  <ManufacturingCostCenterMachine id="1000003" identifier="ManufacturingCostCenterMachine (1000003)">
+  <ManufacturingCostCenterMachine id="1000003" identifier="10000006 ManufacturingCostCenter(1000006) (name: Wood saw) 2007-01-01 00:00:00.0 Wood saw 10000000">
     <id>1000003</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131465,7 +131465,7 @@
     <use>1.0</use>
     <isActive>true</isActive>
   </ManufacturingCostCenterMachine>
-  <ManufacturingCostCenterMachine id="1000004" identifier="ManufacturingCostCenterMachine (1000004)">
+  <ManufacturingCostCenterMachine id="1000004" identifier="10000007 ManufacturingCostCenter(1000007) (name: Wood router) 2007-01-01 00:00:00.0 Wood router 10000001">
     <id>1000004</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131474,7 +131474,7 @@
     <use>1.0</use>
     <isActive>true</isActive>
   </ManufacturingCostCenterMachine>
-  <ManufacturingCostCenterMachine id="1000005" identifier="ManufacturingCostCenterMachine (1000005)">
+  <ManufacturingCostCenterMachine id="1000005" identifier="10000008 ManufacturingCostCenter(1000008) (name: Stone Saw) 2007-01-01 00:00:00.0 Stone Saw 10000002">
     <id>1000005</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131483,7 +131483,7 @@
     <use>1.0</use>
     <isActive>true</isActive>
   </ManufacturingCostCenterMachine>
-  <ManufacturingCostCenterMachine id="1000006" identifier="ManufacturingCostCenterMachine (1000006)">
+  <ManufacturingCostCenterMachine id="1000006" identifier="10000009 ManufacturingCostCenter(1000009) (name: Paint gun) 2007-01-01 00:00:00.0 Paint gun 10000003">
     <id>1000006</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131492,12 +131492,12 @@
     <use>1.0</use>
     <isActive>true</isActive>
   </ManufacturingCostCenterMachine>
-  <EmailServerConfiguration id="4A31472D7A7B41539B32EC83BEEA6DF6" identifier="EmailServerConfiguration (4A31472D7A7B41539B32EC83BEEA6DF6)">
+  <EmailServerConfiguration id="4A31472D7A7B41539B32EC83BEEA6DF6" identifier="smtp.bigbazaar.com ebb823c">
     <id>4A31472D7A7B41539B32EC83BEEA6DF6</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
     <isActive>true</isActive>
-    <smtpserver>smtp.openbravo.com</smtpserver>
+    <smtpserver>smtp.bigbazaar.com</smtpserver>
     <smtpserveraccount>ebb823c</smtpserveraccount>
     <smtpserverpassword>openbravo</smtpserverpassword>
     <isSmtpAuthorization>true</isSmtpAuthorization>
@@ -131643,7 +131643,7 @@
     <reportfilename>Sales Invoice-@our_ref@</reportfilename>
     <templatefilename>RptC_Invoice.jrxml</templatefilename>
   </DocumentTemplate>
-  <EmailInteraction id="54347412388" identifier="EmailInteraction (54347412388)">
+  <EmailInteraction id="54347412388" identifier="2008-10-23 00:00:00.0 eo Neil Riley Productions (invoice monthly)">
     <id>54347412388</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
@@ -131658,7 +131658,7 @@
     <businessPartner id="1000017" entity-name="BusinessPartner" identifier="Neil Riley Productions (invoice monthly)"/>
     <emailType>2</emailType>
   </EmailInteraction>
-  <EmailTemplate id="0439063DF95745CDB1893B130E8EF006" identifier="EmailTemplate (0439063DF95745CDB1893B130E8EF006)">
+  <EmailTemplate id="0439063DF95745CDB1893B130E8EF006" identifier="DocumentType(1000027) (name: On Credit Order) ">
     <id>0439063DF95745CDB1893B130E8EF006</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131669,7 +131669,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="22A44155A4F74A8281C85244F62B8B44" identifier="EmailTemplate (22A44155A4F74A8281C85244F62B8B44)">
+  <EmailTemplate id="22A44155A4F74A8281C85244F62B8B44" identifier="DocumentType(1000011) (name: Purchase Order) ">
     <id>22A44155A4F74A8281C85244F62B8B44</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131680,7 +131680,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="2BC8B0E0EBA64BE8B0E2CAAA88C2E1D0" identifier="EmailTemplate (2BC8B0E0EBA64BE8B0E2CAAA88C2E1D0)">
+  <EmailTemplate id="2BC8B0E0EBA64BE8B0E2CAAA88C2E1D0" identifier="DocumentType(1000024) (name: Prepay Order) ">
     <id>2BC8B0E0EBA64BE8B0E2CAAA88C2E1D0</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131691,7 +131691,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="5B7901EF2D3347CF97F8AA094CD240C9" identifier="EmailTemplate (5B7901EF2D3347CF97F8AA094CD240C9)">
+  <EmailTemplate id="5B7901EF2D3347CF97F8AA094CD240C9" identifier="DocumentType(1000028) (name: Warehouse Order) ">
     <id>5B7901EF2D3347CF97F8AA094CD240C9</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131702,7 +131702,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="63EC39B01EAF49EABF90DB268693FDA5" identifier="EmailTemplate (63EC39B01EAF49EABF90DB268693FDA5)">
+  <EmailTemplate id="63EC39B01EAF49EABF90DB268693FDA5" identifier="DocumentType(1000009) (name: AP CreditMemo) ">
     <id>63EC39B01EAF49EABF90DB268693FDA5</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131713,7 +131713,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="7AB0EF1083B44B19B9A7145BD4DC55A9" identifier="EmailTemplate (7AB0EF1083B44B19B9A7145BD4DC55A9)">
+  <EmailTemplate id="7AB0EF1083B44B19B9A7145BD4DC55A9" identifier="DocumentType(1000029) (name: POS Order) ">
     <id>7AB0EF1083B44B19B9A7145BD4DC55A9</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131724,7 +131724,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="7C25E6165CA04B509E41022004381A6E" identifier="EmailTemplate (7C25E6165CA04B509E41022004381A6E)">
+  <EmailTemplate id="7C25E6165CA04B509E41022004381A6E" identifier="DocumentType(1000003) (name: AR Credit Memo) ">
     <id>7C25E6165CA04B509E41022004381A6E</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131735,7 +131735,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="847CB294260647D2B0205DE1D5A6CDDB" identifier="EmailTemplate (847CB294260647D2B0205DE1D5A6CDDB)">
+  <EmailTemplate id="847CB294260647D2B0205DE1D5A6CDDB" identifier="DocumentType(1000025) (name: Return Material) ">
     <id>847CB294260647D2B0205DE1D5A6CDDB</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131746,7 +131746,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="9095A32AFE3D4A7598636EA7183DCB5D" identifier="EmailTemplate (9095A32AFE3D4A7598636EA7183DCB5D)">
+  <EmailTemplate id="9095A32AFE3D4A7598636EA7183DCB5D" identifier="DocumentType(1000008) (name: AP Invoice) ">
     <id>9095A32AFE3D4A7598636EA7183DCB5D</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131757,7 +131757,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="B60ECA2E5D4A45C9BA5612071CC87C12" identifier="EmailTemplate (B60ECA2E5D4A45C9BA5612071CC87C12)">
+  <EmailTemplate id="B60ECA2E5D4A45C9BA5612071CC87C12" identifier="DocumentType(1000001) (name: AR Invoice) ">
     <id>B60ECA2E5D4A45C9BA5612071CC87C12</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131768,7 +131768,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="CD6EB534BCD0407CBA8CF7FA5F9D86DF" identifier="EmailTemplate (CD6EB534BCD0407CBA8CF7FA5F9D86DF)">
+  <EmailTemplate id="CD6EB534BCD0407CBA8CF7FA5F9D86DF" identifier="DocumentType(1000026) (name: Standard Order) ">
     <id>CD6EB534BCD0407CBA8CF7FA5F9D86DF</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131779,7 +131779,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="E3773F1B235543BC894D68862FED99FA" identifier="EmailTemplate (E3773F1B235543BC894D68862FED99FA)">
+  <EmailTemplate id="E3773F1B235543BC894D68862FED99FA" identifier="DocumentType(1000002) (name: AR Invoice Indirect) ">
     <id>E3773F1B235543BC894D68862FED99FA</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131790,7 +131790,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="E7EF8E74927B4B86B9BCADD0DAAE2E28" identifier="EmailTemplate (E7EF8E74927B4B86B9BCADD0DAAE2E28)">
+  <EmailTemplate id="E7EF8E74927B4B86B9BCADD0DAAE2E28" identifier="DocumentType(1000023) (name: Proposal) ">
     <id>E7EF8E74927B4B86B9BCADD0DAAE2E28</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131801,7 +131801,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <EmailTemplate id="F16DE80FFB8F4F8D8D742A0308FD91FC" identifier="EmailTemplate (F16DE80FFB8F4F8D8D742A0308FD91FC)">
+  <EmailTemplate id="F16DE80FFB8F4F8D8D742A0308FD91FC" identifier="DocumentType(1000022) (name: Quotation) ">
     <id>F16DE80FFB8F4F8D8D742A0308FD91FC</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="0" entity-name="Organization" identifier="*"/>
@@ -131812,7 +131812,7 @@
     <isdefault>true</isdefault>
     <language id="192" entity-name="ADLanguage" identifier="English (USA)"/>
   </EmailTemplate>
-  <OrganizationAcctSchema id="5AEDC6F79ADCDDC0E040007F010138DD" identifier="OrganizationAcctSchema (5AEDC6F79ADCDDC0E040007F010138DD)">
+  <OrganizationAcctSchema id="5AEDC6F79ADCDDC0E040007F010138DD" identifier="Main BigBazaar US/A/Euro">
     <id>5AEDC6F79ADCDDC0E040007F010138DD</id>
     <client id="1000000" entity-name="ADClient" identifier="BigBazaar"/>
     <organization id="1000000" entity-name="Organization" identifier="Main"/>
--- a/src-db/database/model/tables/AD_DATASET.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_DATASET.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -61,6 +61,9 @@
         <default><![CDATA[Y]]></default>
         <onCreateDefault><![CDATA[Y]]></onCreateDefault>
       </column>
+      <foreign-key foreignTable="AD_MODULE" name="AD_DATASET_AD_MODULE">
+        <reference local="AD_MODULE_ID" foreign="AD_MODULE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_CLIENT" name="CLIENT_ADDATASET">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/AD_HEARTBEAT_LOG.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_HEARTBEAT_LOG.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -117,5 +117,11 @@
         <default><![CDATA[0]]></default>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_CLIENT" name="AD_HEARTBEAT_LOG_AD_CLIENT">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="AD_HEARTBEAT_LOG_AD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
     </table>
   </database>
--- a/src-db/database/model/tables/AD_MODULE_LOG.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_MODULE_LOG.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -53,5 +53,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_CLIENT" name="AD_MODULE_LOG_AD_CLIENT">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_MODULE" name="AD_MODULE_LOG_AD_MODULE">
+        <reference local="AD_MODULE_ID" foreign="AD_MODULE_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="AD_MODULE_LOG_AD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
     </table>
   </database>
--- a/src-db/database/model/tables/AD_ORGMODULE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_ORGMODULE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -41,6 +41,9 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_ORG" name="AD_ORGMODULE_AD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_CLIENT" name="ADCLIENT_ADORGMODULE">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/AD_ORG_CLOSING.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_ORG_CLOSING.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -57,6 +57,9 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="C_YEAR" name="AD_ORG_CLOSING_C_YEAR">
+        <reference local="C_YEAR_ID" foreign="C_YEAR_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_CLIENT" name="ADCLIENT_ADORGCLOSING">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/AD_PROCESS_REQUEST.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_PROCESS_REQUEST.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -197,5 +197,17 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_CLIENT" name="AD_PROCESS_REQUEST_AD_CLIENT">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="AD_PROCESS_REQUEST_AD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_PROCESS" name="AD_PROCESS_REQUEST_AD_PROCESS">
+        <reference local="AD_PROCESS_ID" foreign="AD_PROCESS_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_USER" name="AD_PROCESS_REQUEST_AD_USER">
+        <reference local="AD_USER_ID" foreign="AD_USER_ID"/>
+      </foreign-key>
     </table>
   </database>
--- a/src-db/database/model/tables/AD_PROCESS_RUN.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_PROCESS_RUN.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -65,6 +65,12 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_CLIENT" name="AD_PROCESS_RUN_AD_CLIENT">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="AD_PROCESS_RUN_AD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_PROCESS_REQUEST" name="PROCESSREQUEST_PROCESSRUN_FK" onDelete="cascade">
         <reference local="AD_PROCESS_REQUEST_ID" foreign="AD_PROCESS_REQUEST_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/AD_REF_DATA_LOADED.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_REF_DATA_LOADED.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -49,6 +49,9 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_TABLE" name="AD_REF_DATA_LOADED_AD_TABLE">
+        <reference local="AD_TABLE_ID" foreign="AD_TABLE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_CLIENT" name="ADCLIENT_ADREFDATALOADED">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/AD_REF_LIST.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_REF_LIST.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -61,6 +61,9 @@
         <default><![CDATA[0]]></default>
         <onCreateDefault><![CDATA[SELECT AD_MODULE_ID FROM AD_MODULE WHERE AD_MODULE_ID<>'0' AND TYPE='M']]></onCreateDefault>
       </column>
+      <foreign-key foreignTable="AD_MODULE" name="AD_REF_LIST_AD_MODULE">
+        <reference local="AD_MODULE_ID" foreign="AD_MODULE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_REFERENCE" name="AD_REFERENCE_REFLIST" onDelete="cascade">
         <reference local="AD_REFERENCE_ID" foreign="AD_REFERENCE_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/AD_REF_SEARCH.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_REF_SEARCH.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -45,6 +45,9 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_REFERENCE" name="AD_REF_SEARCH_AD_REFERENCE">
+        <reference local="AD_REFERENCE_ID" foreign="AD_REFERENCE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_CLIENT" name="REFSEARCH_FK_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/AD_REGISTRATION_INFO.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_REGISTRATION_INFO.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -45,5 +45,11 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_CLIENT" name="AD_REGISTRATION_INFO_AD_CLIENT">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="AD_REGISTRATION_INFO_AD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
     </table>
   </database>
--- a/src-db/database/model/tables/AD_SYSTEM_INFO.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_SYSTEM_INFO.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -97,6 +97,12 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_CLIENT" name="AD_SYSTEM_INFO_AD_CLIENT">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="AD_SYSTEM_INFO_AD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
       <check name="ADSYSTEMINFO_CUSTOMALLOW_CHECK"><![CDATA[CUSTOMIZATION_ALLOWED IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/src-db/database/model/tables/AD_TABLE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_TABLE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -108,6 +108,9 @@
       <foreign-key foreignTable="AD_PACKAGE" name="AD_PACKAGE_TABLE">
         <reference local="AD_PACKAGE_ID" foreign="AD_PACKAGE_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="AD_WINDOW" name="AD_TABLE_AD_WINDOW">
+        <reference local="PO_WINDOW_ID" foreign="AD_WINDOW_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_WINDOW" name="AD_WINDOW_TABLE" onDelete="setnull">
         <reference local="AD_WINDOW_ID" foreign="AD_WINDOW_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/AD_WINDOW.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/AD_WINDOW.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -85,7 +85,7 @@
         <unique-column name="AD_CLIENT_ID"/>
         <unique-column name="NAME"/>
       </unique>
-      <check name="AD_WINDOW_NAME_CHECK"><![CDATA[INSTR(NAME, chr(39)) = 0 AND INSTR(NAME, TO_CHAR('_')) = 0]]></check>
+      <check name="AD_WINDOW_NAME_CHECK"><![CDATA[(INSTR(NAME, (CHR(39))) = 0) AND (INSTR(NAME, TO_CHAR('_')) = 0)]]></check>
       <check name="ADWINDOW_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
       <check name="ADWINDOW_ISSOTRX_CHECK"><![CDATA[ISSOTRX IN ('Y', 'N')]]></check>
     </table>
--- a/src-db/database/model/tables/C_ACCTSCHEMA_GL.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_ACCTSCHEMA_GL.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -91,6 +91,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_CACCTSCHEMAGL">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_VALIDCOMBINATION" name="C_ACCTSCHM_GL_C_VLDCMBNTN">
+        <reference local="CFS_ORDER_ACCT" foreign="C_VALIDCOMBINATION_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_ACCTSCHEMA" name="CACCTSCHEMA_CACCTSCHEMAGL" onDelete="cascade">
         <reference local="C_ACCTSCHEMA_ID" foreign="C_ACCTSCHEMA_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_ACCTSCHEMA_TABLE_DOCTYPE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_ACCTSCHEMA_TABLE_DOCTYPE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -51,6 +51,9 @@
       <foreign-key foreignTable="AD_ORG" name="AD_ORG_C_ACCTSCHEMA_TAB_DOC">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_ACCTSCHEMA_TABLE" name="C_CCTSCHM_TBL_DCTP_C_CCTSCHM_TBL">
+        <reference local="C_ACCTSCHEMA_TABLE_ID" foreign="C_ACCTSCHEMA_TABLE_ID"/>
+      </foreign-key>
       <check name="C_ACCTSCH_TA_DO_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
       <check name="C_ACCTSCH_TA_DO_NEGATIVE_CHECK"><![CDATA[ALLOWNEGATIVE IN ('Y', 'N')]]></check>
     </table>
--- a/src-db/database/model/tables/C_ACCT_RPT.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_ACCT_RPT.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -55,6 +55,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_CACCTRPT">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_ACCTSCHEMA" name="C_ACCT_RPT_C_ACCTSCHEMA">
+        <reference local="C_ACCTSCHEMA_ID" foreign="C_ACCTSCHEMA_ID"/>
+      </foreign-key>
       <check name="C_ACCT_RPT_ISORGBALANCED_CHECK"><![CDATA[ISORGBALANCED IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/src-db/database/model/tables/C_ACCT_RPT_NODE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_ACCT_RPT_NODE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -59,6 +59,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_CACCTRPTNODE">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_ELEMENTVALUE" name="C_ACCT_RPT_NODE_C_ELEMENTVALUE">
+        <reference local="C_ELEMENTVALUE_ID" foreign="C_ELEMENTVALUE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_ACCT_RPT_GROUP" name="CACCTRPTGROUP_CACCTRPTNODE">
         <reference local="C_ACCT_RPT_GROUP_ID" foreign="C_ACCT_RPT_GROUP_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_BANKSTATEMENTLINE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_BANKSTATEMENTLINE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -107,6 +107,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_CBANKSTATEMENTLINE">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_GLITEM" name="C_BANKSTATEMENTLINE_C_GLITEM">
+        <reference local="C_GLITEM_ID" foreign="C_GLITEM_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_BANKSTATEMENT" name="CBSTATEMENT_CBSTATEMENTLINE">
         <reference local="C_BANKSTATEMENT_ID" foreign="C_BANKSTATEMENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_BPARTNER.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_BPARTNER.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -316,6 +316,9 @@
       <foreign-key foreignTable="C_BP_TAXCATEGORY" name="BP_CBPTAXCATEGORYSO">
         <reference local="SO_BP_TAXCATEGORY_ID" foreign="C_BP_TAXCATEGORY_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_BPARTNER" name="C_BPARTNER_C_BPARTNER">
+        <reference local="SALESREP_ID" foreign="C_BPARTNER_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_SALARY_CATEGORY" name="C_SALARY_CATEGORY_CBPARTNER">
         <reference local="C_SALARY_CATEGORY_ID" foreign="C_SALARY_CATEGORY_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_BP_BANKACCOUNT.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_BP_BANKACCOUNT.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -142,6 +142,9 @@
       <foreign-key foreignTable="AD_USER" name="ADUSER_CBPBANKACCOUNT">
         <reference local="AD_USER_ID" foreign="AD_USER_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_COUNTRY" name="C_BP_BANKACCOUNT_C_COUNTRY">
+        <reference local="C_COUNTRY_ID" foreign="C_COUNTRY_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_BPARTNER" name="CBPARTNER_CBPBANKACCOUNT" onDelete="cascade">
         <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_BP_SALCATEGORY.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_BP_SALCATEGORY.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -51,6 +51,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_CBPEMSALCATEG">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_BPARTNER" name="C_BP_SALCATEGORY_C_BPARTNER">
+        <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_SALARY_CATEGORY" name="CSALARYCAT_CBPEMSALCATEG">
         <reference local="C_SALARY_CATEGORY_ID" foreign="C_SALARY_CATEGORY_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_CASHLINE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_CASHLINE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -95,6 +95,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_CCASHLINE">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_GLITEM" name="C_CASHLINE_C_GLITEM">
+        <reference local="C_GLITEM_ID" foreign="C_GLITEM_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_CASH" name="CCASH_CCASHLINE" onDelete="cascade">
         <reference local="C_CASH_ID" foreign="C_CASH_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_COMMISSIONLINE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_COMMISSIONLINE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -99,6 +99,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORGTRX_CCOMMISSIONLINE">
         <reference local="ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="C_COMMISSIONLINE_AD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_BPARTNER" name="CBPARTNER_CCOMMISSIONLINE">
         <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_DEBT_PAYMENT.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_DEBT_PAYMENT.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -163,6 +163,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_CDEBTPAYMENT">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_WITHHOLDING" name="C_DEBT_PAYMENT_C_WITHHOLDING">
+        <reference local="C_WITHHOLDING_ID" foreign="C_WITHHOLDING_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_BANKACCOUNT" name="CBANKACCOUNT_CDEBTPAYMENT">
         <reference local="C_BANKACCOUNT_ID" foreign="C_BANKACCOUNT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_DOCTYPE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_DOCTYPE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -113,6 +113,9 @@
       <foreign-key foreignTable="AD_TABLE" name="ADTABLE_CDOCTYPE">
         <reference local="AD_TABLE_ID" foreign="AD_TABLE_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_DOCTYPE" name="C_DOCTYPE_C_DOCTYPE">
+        <reference local="C_DOCTYPE_REVERSED_ID" foreign="C_DOCTYPE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_DOCTYPE" name="CDOCTYPE_INVOICE">
         <reference local="C_DOCTYPEINVOICE_ID" foreign="C_DOCTYPE_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_INVOICE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_INVOICE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -227,6 +227,9 @@
       <foreign-key foreignTable="C_BPARTNER_LOCATION" name="C_BPLOCATION_CINVOICE">
         <reference local="C_BPARTNER_LOCATION_ID" foreign="C_BPARTNER_LOCATION_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_WITHHOLDING" name="C_INVOICE_C_WITHHOLDING">
+        <reference local="C_WITHHOLDING_ID" foreign="C_WITHHOLDING_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_ACTIVITY" name="CACTIVITY_CINVOICE">
         <reference local="C_ACTIVITY_ID" foreign="C_ACTIVITY_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_ORDER.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_ORDER.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -290,6 +290,9 @@
       <foreign-key foreignTable="C_DOCTYPE" name="C_DOCTYPE_CORDER">
         <reference local="C_DOCTYPE_ID" foreign="C_DOCTYPE_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_BPARTNER_LOCATION" name="C_ORDER_C_BPARTNER_LOCATION">
+        <reference local="DELIVERY_LOCATION_ID" foreign="C_BPARTNER_LOCATION_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_ACTIVITY" name="CACTIVITY_CORDER">
         <reference local="C_ACTIVITY_ID" foreign="C_ACTIVITY_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_POC_EMAILDEFINITION.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_POC_EMAILDEFINITION.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -59,6 +59,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_C_POC_EMA_MAILDEFINITION">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="AD_LANGUAGE" name="C_PC_EMAILDFNTN_D_LNGG">
+        <reference local="AD_LANGUAGE" foreign="AD_LANGUAGE"/>
+      </foreign-key>
       <foreign-key foreignTable="C_POC_DOCTYPE_TEMPLATE" name="CPOCDOCTYPETEM_CPOC_EMAILDEF">
         <reference local="C_POC_DOCTYPE_TEMPLATE_ID" foreign="C_POC_DOCTYPE_TEMPLATE_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_REMITTANCELINE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_REMITTANCELINE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -59,6 +59,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_CREMITTANCELINE">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_REMITTANCE" name="C_REMITTANCELINE_C_REMITTANCE">
+        <reference local="C_REMITTANCE_ID" foreign="C_REMITTANCE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_DEBT_PAYMENT" name="CDEBTPAYMENT_CREMITTANCELINE">
         <reference local="C_DEBT_PAYMENT_ID" foreign="C_DEBT_PAYMENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/C_SALESREGION.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_SALESREGION.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -63,6 +63,9 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_CSALESREGION">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="AD_USER" name="C_SALESREGION_AD_USER">
+        <reference local="SALESREP_ID" foreign="AD_USER_ID"/>
+      </foreign-key>
       <unique name="C_SALESREGION_VALUE">
         <unique-column name="AD_CLIENT_ID"/>
         <unique-column name="VALUE"/>
--- a/src-db/database/model/tables/C_TAXREGISTERLINE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/C_TAXREGISTERLINE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -81,6 +81,12 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <foreign-key foreignTable="AD_CLIENT" name="C_TAXREGISTERLINE_AD_CLIENT">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="C_TAXREGISTERLINE_AD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_TAX" name="CTAX_FK_TAXREGISTERLINE">
         <reference local="C_TAX_ID" foreign="C_TAX_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/FACT_ACCT_CFS.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/FACT_ACCT_CFS.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -55,6 +55,12 @@
       <foreign-key foreignTable="AD_ORG" name="ADORG_FACTACCTCFS">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_ELEMENTVALUE" name="FACT_ACCT_CFS_C_ELEMENTVALUE">
+        <reference local="ACCOUNT_ID" foreign="C_ELEMENTVALUE_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="FACT_ACCT" name="FACT_ACCT_CFS_FACT_ACCT">
+        <reference local="FACT_ACCT_REF_ID" foreign="FACT_ACCT_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="FACT_ACCT" name="FACTACCT_FACTACCTCFS" onDelete="cascade">
         <reference local="FACT_ACCT_ID" foreign="FACT_ACCT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/M_INOUT.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/M_INOUT.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -278,6 +278,9 @@
       <foreign-key foreignTable="M_FREIGHTCATEGORY" name="M_FREIGHTCATEGORY_M_INOUT">
         <reference local="M_FREIGHTCATEGORY_ID" foreign="M_FREIGHTCATEGORY_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_BPARTNER_LOCATION" name="M_INOUT_C_BPARTNER_LOCATION">
+        <reference local="DELIVERY_LOCATION_ID" foreign="C_BPARTNER_LOCATION_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="M_SHIPPER" name="MSHIPPER_MINOUT">
         <reference local="M_SHIPPER_ID" foreign="M_SHIPPER_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/M_PRODUCT.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/M_PRODUCT.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -295,6 +295,15 @@
       <foreign-key foreignTable="C_UOM" name="CUOM_MPRODUCT">
         <reference local="C_UOM_ID" foreign="C_UOM_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="AD_USER" name="M_PRODUCT_AD_USER">
+        <reference local="SALESREP_ID" foreign="AD_USER_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="MRP_PLANNER" name="M_PRODUCT_MRP_PLANNER">
+        <reference local="MRP_PLANNER_ID" foreign="MRP_PLANNER_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="MRP_PLANNINGMETHOD" name="M_PRODUCT_MRP_PLANNINGMETHOD">
+        <reference local="MRP_PLANNINGMETHOD_ID" foreign="MRP_PLANNINGMETHOD_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="MA_PROCESSPLAN" name="MA_PROCESSPLAN_MPRODUCT">
         <reference local="MA_PROCESSPLAN_ID" foreign="MA_PROCESSPLAN_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/M_PRODUCT_ORG.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/M_PRODUCT_ORG.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -87,6 +87,12 @@
       <foreign-key foreignTable="M_LOCATOR" name="LOCATOR_FK_PRODUCTORG">
         <reference local="M_LOCATOR_ID" foreign="M_LOCATOR_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="MRP_PLANNER" name="M_PRODUCT_ORG_MRP_PLANNER">
+        <reference local="MRP_PLANNER_ID" foreign="MRP_PLANNER_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="MRP_PLANNINGMETHOD" name="M_PRDCT_RG_MRP_PLNNNGMTHD">
+        <reference local="MRP_PLANNINGMETHOD_ID" foreign="MRP_PLANNINGMETHOD_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_ORG" name="ORG_FK_PRODUCTORG">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/M_REQUISITIONLINE.xml	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-db/database/model/tables/M_REQUISITIONLINE.xml	Wed Jan 28 14:17:33 2009 +0000
@@ -175,6 +175,9 @@
       <foreign-key foreignTable="M_REQUISITION" name="M_REQUISITION_MREQUISITIONLINE">
         <reference local="M_REQUISITION_ID" foreign="M_REQUISITION_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_CURRENCY" name="M_REQUISITIONLINE_C_CURRENCY">
+        <reference local="C_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
+      </foreign-key>
       <check name="M_REQUISITIONLI_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/src-test/org/openbravo/test/system/SystemValidatorTest.java	Wed Jan 28 13:28:51 2009 +0000
+++ b/src-test/org/openbravo/test/system/SystemValidatorTest.java	Wed Jan 28 14:17:33 2009 +0000
@@ -19,11 +19,13 @@
 
 package org.openbravo.test.system;
 
+import java.util.List;
 import java.util.Map;
 
 import org.openbravo.service.system.ApplicationDictionaryValidator;
 import org.openbravo.service.system.ModuleValidator;
 import org.openbravo.service.system.SystemValidationResult;
+import org.openbravo.service.system.SystemValidationResult.SystemValidationType;
 import org.openbravo.test.base.BaseTest;
 
 /**
@@ -48,13 +50,7 @@
 	    System.err
 		    .println("++++++++++++++++++++++++++++++++++++++++++++++++++");
 	    final SystemValidationResult result = results.get(key);
-	    for (String warning : result.getWarnings()) {
-		System.err.println("Warning: " + warning);
-	    }
-	    System.err.println("------------------------------------");
-	    for (String error : result.getErrors()) {
-		System.err.println("Error: " + error);
-	    }
+	    printResult(result);
 	}
 	setErrorOccured(false);
     }
@@ -64,13 +60,40 @@
 	setUserContext("0");
 	final ModuleValidator moduleValidator = new ModuleValidator();
 	final SystemValidationResult result = moduleValidator.validate();
-
-	for (String warning : result.getWarnings()) {
-	    System.err.println("Warning: " + warning);
-	}
-	for (String error : result.getErrors()) {
-	    System.err.println("Error: " + error);
-	}
+	printResult(result);
 	setErrorOccured(false);
     }
+
+    private void printResult(SystemValidationResult result) {
+	for (SystemValidationType validationType : result.getWarnings()
+		.keySet()) {
+	    System.err
+		    .println("\n+++++++++++++++++++++++++++++++++++++++++++++++++++");
+	    System.err.println("Warnings for Validation type: "
+		    + validationType);
+	    System.err
+		    .println("\n+++++++++++++++++++++++++++++++++++++++++++++++++++");
+	    final List<String> warnings = result.getWarnings().get(
+		    validationType);
+	    for (String warning : warnings) {
+		System.err.println(warning);
+	    }
+	}
+
+	final StringBuilder sb = new StringBuilder();
+	for (SystemValidationType validationType : result.getErrors().keySet()) {
+	    sb.append("\n+++++++++++++++++++++++++++++++++++++++++++++++++++");
+	    sb.append("Errors for Validation type: " + validationType);
+	    sb.append("\n+++++++++++++++++++++++++++++++++++++++++++++++++++");
+	    final List<String> errors = result.getErrors().get(validationType);
+	    for (String err : errors) {
+		sb.append(err);
+		if (sb.length() > 0) {
+		    sb.append("\n");
+		}
+	    }
+	}
+	System.err.println(sb.toString());
+    }
+
 }
\ No newline at end of file
--- a/src/org/openbravo/base/model/Property.java	Wed Jan 28 13:28:51 2009 +0000
+++ b/src/org/openbravo/base/model/Property.java	Wed Jan 28 14:17:33 2009 +0000
@@ -386,6 +386,12 @@
 	}
 
 	if (defaultValue != null && isPrimitive()) {
+	    // strip the ' and ;
+	    if (defaultValue.startsWith("'") && defaultValue.endsWith("'")) {
+		defaultValue = defaultValue.substring(1,
+			defaultValue.length() - 1);
+	    }
+
 	    if (defaultValue.startsWith("@")) {
 		return null;
 	    }
--- a/src/org/openbravo/service/system/DatabaseValidator.java	Wed Jan 28 13:28:51 2009 +0000
+++ b/src/org/openbravo/service/system/DatabaseValidator.java	Wed Jan 28 14:17:33 2009 +0000
@@ -34,7 +34,6 @@
 import org.apache.ddlutils.model.ForeignKey;
 import org.apache.ddlutils.model.Reference;
 import org.apache.ddlutils.model.View;
-import org.apache.log4j.Logger;
 import org.hibernate.criterion.Expression;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
@@ -44,6 +43,7 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.ad.datamodel.Column;
 import org.openbravo.model.ad.datamodel.Table;
+import org.openbravo.service.system.SystemValidationResult.SystemValidationType;
 
 /**
  * Validates the database model against the application dictionary and checks
@@ -52,8 +52,6 @@
  * @author mtaal
  */
 public class DatabaseValidator implements SystemValidator {
-    private static final Logger log = Logger.getLogger(DatabaseValidator.class);
-
     private Database database;
 
     public String getCategory() {
@@ -106,10 +104,13 @@
 	    final View view = dbViews.get(adTable.getTableName().toUpperCase());
 	    if (view == null && dbTable == null) {
 		// in Application Dictionary not in Physical Table
-		result.getErrors().add(
-			"Table " + adTable.getTableName()
-				+ " defined in the Application Dictionary"
-				+ " but is not present in the database");
+		result
+			.addError(
+				SystemValidationResult.SystemValidationType.NOT_EXIST_IN_DB,
+				"Table "
+					+ adTable.getTableName()
+					+ " defined in the Application Dictionary"
+					+ " but is not present in the database");
 	    } else if (view != null) {
 		dbViews.remove(view.getName().toUpperCase());
 	    } else {
@@ -120,15 +121,23 @@
 
 	for (org.apache.ddlutils.model.Table dbTable : tmpDBTablesByName
 		.values()) {
-	    result.getWarnings().add(
-		    "Table " + dbTable.getName() + " present in the database "
-			    + " but not defined in the Application Dictionary");
+	    result
+		    .addWarning(
+			    SystemValidationResult.SystemValidationType.NOT_EXIST_IN_AD,
+			    "Table "
+				    + dbTable.getName()
+				    + " present in the database "
+				    + " but not defined in the Application Dictionary");
 	}
 
 	for (View view : dbViews.values()) {
-	    result.getWarnings().add(
-		    "View " + view.getName() + " present in the database "
-			    + " but not defined in the Application Dictionary");
+	    result
+		    .addWarning(
+			    SystemValidationResult.SystemValidationType.NOT_EXIST_IN_AD,
+			    "View "
+				    + view.getName()
+				    + " present in the database "
+				    + " but not defined in the Application Dictionary");
 	}
 	return result;
     }
@@ -138,9 +147,11 @@
 	    SystemValidationResult result) {
 	for (org.apache.ddlutils.model.Table dbTable : dbTables) {
 	    if (dbTable.getPrimaryKeyColumns().length == 0) {
-		result.getWarnings().add(
-			"Table " + dbTable.getName()
-				+ " has no primary key columns.");
+		result
+			.addWarning(
+				SystemValidationResult.SystemValidationType.NO_PRIMARY_KEY_COLUMNS,
+				"Table " + dbTable.getName()
+					+ " has no primary key columns.");
 	    }
 	}
     }
@@ -195,9 +206,26 @@
 		    }
 		}
 		if (!found) {
+		    final String fk = "ALTER TABLE "
+			    + property.getEntity().getTableName().toLowerCase()
+			    + " ADD CONSTRAINT "
+			    + (property.getEntity().getTableName() + "_" + property
+				    .getTargetEntity().getTableName())
+				    .toLowerCase()
+			    + " FOREIGN KEY ("
+			    + property.getColumnName().toLowerCase()
+			    + ")"
+			    + " REFERENCES "
+			    + property.getTargetEntity().getTableName()
+				    .toLowerCase()
+			    + " ("
+			    + property.getReferencedProperty().getColumnName()
+				    .toLowerCase() + ") MATCH SIMPLE"
+			    + " ON UPDATE NO ACTION ON DELETE NO ACTION;";
+		    System.err.println(fk);
 		    result
-			    .getWarnings()
-			    .add(
+			    .addWarning(
+				    SystemValidationResult.SystemValidationType.NOT_PART_OF_FOREIGN_KEY,
 				    "Foreign Key Column "
 					    + table.getName()
 					    + "."
@@ -221,11 +249,15 @@
 	    final org.apache.ddlutils.model.Column dbColumn = dbColumnsByName
 		    .get(column.getColumnName().toUpperCase());
 	    if (dbColumn == null) {
-		result.getErrors().add(
-			"Column " + adTable.getTableName() + "."
-				+ column.getColumnName()
-				+ " defined in the Application Dictionary "
-				+ " but not present in the database.");
+		result
+			.addError(
+				SystemValidationResult.SystemValidationType.NOT_EXIST_IN_DB,
+				"Column "
+					+ adTable.getTableName()
+					+ "."
+					+ column.getColumnName()
+					+ " defined in the Application Dictionary "
+					+ " but not present in the database.");
 	    } else {
 		checkDataType(column, dbColumn, result, dbTable);
 		dbColumnsByName.remove(column.getColumnName().toUpperCase());
@@ -235,8 +267,8 @@
 	for (org.apache.ddlutils.model.Column dbColumn : dbColumnsByName
 		.values()) {
 	    result
-		    .getWarnings()
-		    .add(
+		    .addWarning(
+			    SystemValidationResult.SystemValidationType.NOT_EXIST_IN_AD,
 			    "Column "
 				    + dbTable.getName()
 				    + "."
@@ -257,8 +289,8 @@
 	if (property != null && !property.isMandatory()
 		&& dbColumn.isRequired()) {
 	    result
-		    .getWarnings()
-		    .add(
+		    .addWarning(
+			    SystemValidationResult.SystemValidationType.NOT_NULL_IN_DB_NOT_MANDATORY_IN_AD,
 			    "Column "
 				    + dbTable.getName()
 				    + "."
@@ -269,8 +301,8 @@
 	if (property != null && property.isMandatory()
 		&& !dbColumn.isRequired()) {
 	    result
-		    .getWarnings()
-		    .add(
+		    .addWarning(
+			    SystemValidationType.MANDATORY_IN_AD_NULLABLE_IN_DB,
 			    "Column "
 				    + dbTable.getName()
 				    + "."
@@ -279,6 +311,18 @@
 				    + " it is set as mandatory");
 	}
 
+	// check the default value
+	if (property != null && property.getActualDefaultValue() != null) {
+	    try {
+		property.checkIsValidValue(property.getActualDefaultValue());
+	    } catch (Exception e) {
+		// actually a ValidationException is thrown but this is not
+		// accepted by the compiler
+		result.addError(SystemValidationType.INCORRECT_DEFAULT_VALUE, e
+			.getMessage());
+	    }
+	}
+
 	if (dbColumn.isPrimaryKey()) {
 	    checkType(dbColumn, dbTable, result, "VARCHAR");
 	    checkLength(dbColumn, dbTable, result, 32);
@@ -289,7 +333,12 @@
 	    // ignore those
 	} else if (property != null && !property.isPrimitive()) {
 	    checkType(dbColumn, dbTable, result, "VARCHAR");
-	    checkLength(dbColumn, dbTable, result, 32);
+	    if (property.getReferencedProperty() != null) {
+		checkLength(dbColumn, dbTable, result, property
+			.getReferencedProperty().getFieldLength());
+	    } else {
+		checkLength(dbColumn, dbTable, result, 32);
+	    }
 	} else if (property != null
 		&& property.getPrimitiveObjectType() != null) {
 	    final Class<?> prim = property.getPrimitiveObjectType();
@@ -328,10 +377,10 @@
 	    }
 	}
 	if (!found) {
-	    result.getWarnings().add(
-		    "Column " + dbTable.getName() + "." + dbColumn.getName()
-			    + " has incorrect type, expecting " + sb.toString()
-			    + "but was " + dbColumn.getType());
+	    result.addWarning(SystemValidationType.WRONG_TYPE, "Column "
+		    + dbTable.getName() + "." + dbColumn.getName()
+		    + " has incorrect type, expecting " + sb.toString()
+		    + "but was " + dbColumn.getType());
 	}
     }
 
@@ -339,10 +388,10 @@
 	    org.apache.ddlutils.model.Table dbTable,
 	    SystemValidationResult result, String expectedType) {
 	if (!dbColumn.getType().equals(expectedType)) {
-	    result.getWarnings().add(
-		    "Column " + dbTable.getName() + "." + dbColumn.getName()
-			    + " has incorrect type, expecting " + expectedType
-			    + " but was " + dbColumn.getType());
+	    result.addWarning(SystemValidationType.WRONG_TYPE, "Column "
+		    + dbTable.getName() + "." + dbColumn.getName()
+		    + " has incorrect type, expecting " + expectedType
+		    + " but was " + dbColumn.getType());
 	}
     }
 
@@ -350,11 +399,10 @@
 	    org.apache.ddlutils.model.Table dbTable,
 	    SystemValidationResult result, int expectedLength) {
 	if (dbColumn.getSizeAsInt() != expectedLength) {
-	    result.getWarnings().add(
-		    "Column " + dbTable.getName() + "." + dbColumn.getName()
-			    + " has incorrect length, expecting "
-			    + expectedLength + " but was "
-			    + dbColumn.getSizeAsInt());
+	    result.addWarning(SystemValidationType.WRONG_LENGTH, "Column "
+		    + dbTable.getName() + "." + dbColumn.getName()
+		    + " has incorrect length, expecting " + expectedLength
+		    + " but was " + dbColumn.getSizeAsInt());
 	}
     }
 
--- a/src/org/openbravo/service/system/ModuleValidator.java	Wed Jan 28 13:28:51 2009 +0000
+++ b/src/org/openbravo/service/system/ModuleValidator.java	Wed Jan 28 14:17:33 2009 +0000
@@ -37,6 +37,7 @@
 import org.openbravo.model.ad.ui.TextInterface;
 import org.openbravo.model.ad.ui.Window;
 import org.openbravo.model.ad.ui.Workflow;
+import org.openbravo.service.system.SystemValidationResult.SystemValidationType;
 
 /**
  * Validates modules, their dependencies and licenses
@@ -69,7 +70,8 @@
 	modules.add(Expression.eq(Module.PROPERTY_NAME, moduleName));
 
 	if (modules.list().size() == 0) {
-	    result.getErrors().add("Module " + moduleName + " does not exist");
+	    result.addError(SystemValidationType.MODULE_ERROR, "Module "
+		    + moduleName + " does not exist");
 	    return result;
 	}
 	final Module module = modules.list().get(0);
@@ -84,7 +86,8 @@
 	final Module module = OBDal.getInstance().get(Module.class, moduleId);
 
 	if (module == null) {
-	    result.getErrors().add("Module " + moduleId + " does not exist");
+	    result.addError(SystemValidationType.MODULE_ERROR, "Module "
+		    + moduleId + " does not exist");
 	    return result;
 	}
 
@@ -102,9 +105,10 @@
 
 	final File moduleDir = new File(modulesDir, module.getJavaPackage());
 	if (!moduleDir.exists()) {
-	    result.getErrors().add(
-		    "Module directory (" + moduleDir.getAbsolutePath()
-			    + ") not found, has the module been installed?");
+	    result.addError(SystemValidationType.MODULE_ERROR,
+
+	    "Module directory (" + moduleDir.getAbsolutePath()
+		    + ") not found, has the module been installed?");
 	    return;
 	}
 
@@ -118,11 +122,12 @@
 	checkHasUIArtifact(module, result);
 
 	if (module.getLicense() == null || module.getLicenseType() == null) {
-	    result.getErrors().add(
-		    "The license and/or the licenseType of the Module "
-			    + module.getName()
-			    + " are not set, before exporting these "
-			    + "fields should be set");
+	    result.addError(SystemValidationType.MODULE_ERROR,
+
+	    "The license and/or the licenseType of the Module "
+		    + module.getName()
+		    + " are not set, before exporting these "
+		    + "fields should be set");
 	}
 
 	// industry template
@@ -135,11 +140,11 @@
 		}
 	    }
 	    if (!found) {
-		result.getErrors().add(
-			"Module " + module.getName()
-				+ " is an Industry Template must depend "
-				+ "on Core and the dependency relation "
-				+ "must have isIncluded set to true");
+		result.addError(SystemValidationType.MODULE_ERROR, "Module "
+			+ module.getName()
+			+ " is an Industry Template must depend "
+			+ "on Core and the dependency relation "
+			+ "must have isIncluded set to true");
 	    }
 	}
     }
@@ -155,7 +160,7 @@
 	for (String part : paths) {
 	    final File partDir = new File(curDir, part);
 	    if (!partDir.exists()) {
-		result.getErrors().add(
+		result.addError(SystemValidationType.MODULE_ERROR,
 			"The source directory of the Module "
 				+ module.getName()
 				+ " is invalid, it should follow the "
@@ -163,8 +168,8 @@
 	    }
 	    if (curDir.listFiles().length > 1) {
 		result
-			.getErrors()
-			.add(
+			.addError(
+				SystemValidationType.MODULE_ERROR,
 				"The source directory of the Module "
 					+ module.getName()
 					+ " is invalid, it contains directories "
@@ -191,8 +196,8 @@
 		|| hasArtifact(Workflow.class, module);
 	if (reportError) {
 	    result
-		    .getErrors()
-		    .add(
+		    .addError(
+			    SystemValidationType.MODULE_ERROR,
 			    "Module "
 				    + module.getName()
 				    + " has UI Artifacts, "
@@ -214,7 +219,7 @@
 		    .getDependentModule(), module.getId());
 	    if (dependentModule != null) {
 		if (dependentModule.getId().equals(module.getId())) {
-		    result.getErrors().add(
+		    result.addError(SystemValidationType.MODULE_ERROR,
 			    "Cycle in module dependencies with module "
 				    + module.getName());
 		    coreModuleFound = true; // prevents additional message
@@ -227,9 +232,9 @@
 	    }
 	}
 	if (!coreModuleFound) {
-	    result.getErrors().add(
-		    "Module " + module.getName() + " or any of its ancestors "
-			    + "does not depend on the Core module.");
+	    result.addError(SystemValidationType.MODULE_ERROR, "Module "
+		    + module.getName() + " or any of its ancestors "
+		    + "does not depend on the Core module.");
 	}
 
     }
@@ -239,8 +244,8 @@
 		.getPackageList()) {
 	    if (!pckg.getJavaPackage().startsWith(module.getJavaPackage())) {
 		result
-			.getErrors()
-			.add(
+			.addError(
+				SystemValidationType.MODULE_ERROR,
 				"Data package "
 					+ pckg.getName()
 					+ " has a java package which is not within the java package of its module "
--- a/src/org/openbravo/service/system/SystemValidationResult.java	Wed Jan 28 13:28:51 2009 +0000
+++ b/src/org/openbravo/service/system/SystemValidationResult.java	Wed Jan 28 14:17:33 2009 +0000
@@ -20,7 +20,9 @@
 package org.openbravo.service.system;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Keeps track of the errors/warnings for a certain type of validation.
@@ -29,23 +31,73 @@
  */
 public class SystemValidationResult {
 
-    private List<String> warnings = new ArrayList<String>();
-    private List<String> errors = new ArrayList<String>();
+    public enum SystemValidationType {
+	MODULE_ERROR, INCORRECT_DEFAULT_VALUE, WRONG_LENGTH, NO_PRIMARY_KEY_COLUMNS, NOT_NULL_IN_DB_NOT_MANDATORY_IN_AD, MANDATORY_IN_AD_NULLABLE_IN_DB, NOT_EXIST_IN_AD, NOT_EXIST_IN_DB, NOT_PART_OF_FOREIGN_KEY, WRONG_TYPE;
+
+	public String getName() {
+	    return this.getClass().getSimpleName();
+	}
+    }
+
+    private Map<SystemValidationType, List<String>> warnings = new HashMap<SystemValidationType, List<String>>();
+    private Map<SystemValidationType, List<String>> errors = new HashMap<SystemValidationType, List<String>>();
+
     private String category;
 
-    public List<String> getWarnings() {
-        return warnings;
+    /**
+     * Adds a warning to the result for a specific validation type.
+     * 
+     * @param validationType
+     *            the type of warning
+     * @param warning
+     *            the message itself
+     */
+    public void addWarning(SystemValidationType validationType, String warning) {
+	addToResult(warnings, validationType, warning);
     }
 
-    public List<String> getErrors() {
-        return errors;
+    /**
+     * Adds an error message to the result.
+     * 
+     * @param validationType
+     *            the type of message
+     * @param error
+     *            the message text
+     */
+    public void addError(SystemValidationType validationType, String error) {
+	addToResult(errors, validationType, error);
+    }
+
+    private void addToResult(Map<SystemValidationType, List<String>> result,
+	    SystemValidationType validationType, String msg) {
+
+	List<String> msgList = result.get(validationType);
+	if (msgList == null) {
+	    msgList = new ArrayList<String>();
+	    result.put(validationType, msgList);
+	}
+	msgList.add(msg);
+    }
+
+    /**
+     * @return Returns the list of error messages by validationType.
+     */
+    public Map<SystemValidationType, List<String>> getErrors() {
+	return errors;
+    }
+
+    /**
+     * @return Returns the list of warning messages by validationType.
+     */
+    public Map<SystemValidationType, List<String>> getWarnings() {
+	return warnings;
     }
 
     public String getCategory() {
-        return category;
+	return category;
     }
 
     public void setCategory(String category) {
-        this.category = category;
+	this.category = category;
     }
 }
--- a/src/org/openbravo/service/system/SystemValidationTask.java	Wed Jan 28 13:28:51 2009 +0000
+++ b/src/org/openbravo/service/system/SystemValidationTask.java	Wed Jan 28 14:17:33 2009 +0000
@@ -19,9 +19,12 @@
 
 package org.openbravo.service.system;
 
+import java.util.List;
+
 import org.apache.log4j.Logger;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.service.db.ReferenceDataTask;
+import org.openbravo.service.system.SystemValidationResult.SystemValidationType;
 
 /**
  * Performs different types of validations on the basis of the type parameter.
@@ -40,39 +43,61 @@
 	if (getType().contains("database")) {
 	    log.info("Validating Database and Application Dictionary");
 	    final DatabaseValidator databaseValidator = new DatabaseValidator();
-	    printResult(databaseValidator.validate());
+	    final SystemValidationResult result = databaseValidator.validate();
+	    if (result.getErrors().isEmpty() && result.getWarnings().isEmpty()) {
+		log.warn("Validation successfull no warnings or errors");
+	    } else {
+		printResult(result);
+	    }
 	}
 	if (getType().contains("module")) {
 	    log.info("Validating Modules");
 	    final ModuleValidator moduleValidator = new ModuleValidator();
+	    final SystemValidationResult result;
 	    if (getModuleName() != null) {
-		printResult(moduleValidator.validate(getModuleName()));
+		result = moduleValidator.validate(getModuleName());
 	    } else {
-		printResult(moduleValidator.validate());
+		result = moduleValidator.validate();
+	    }
+	    if (result.getErrors().isEmpty() && result.getWarnings().isEmpty()) {
+		log.warn("Validation successfull no warnings or errors");
+	    } else {
+		printResult(result);
 	    }
 	}
     }
 
     private void printResult(SystemValidationResult result) {
-	for (String warning : result.getWarnings()) {
-	    log.warn(warning);
+	for (SystemValidationType validationType : result.getWarnings()
+		.keySet()) {
+	    log.warn("\n");
+	    log.warn("+++++++++++++++++++++++++++++++++++++++++++++++++++");
+	    log.warn("Warnings for Validation type: " + validationType);
+	    log.warn("+++++++++++++++++++++++++++++++++++++++++++++++++++");
+	    final List<String> warnings = result.getWarnings().get(
+		    validationType);
+	    for (String warning : warnings) {
+		log.warn(warning);
+	    }
 	}
 
-	if (isFailOnError()) {
-	    final StringBuilder sb = new StringBuilder();
-	    for (String err : result.getErrors()) {
+	final StringBuilder sb = new StringBuilder();
+	for (SystemValidationType validationType : result.getErrors().keySet()) {
+	    sb.append("\n");
+	    sb.append("+++++++++++++++++++++++++++++++++++++++++++++++++++");
+	    sb.append("Errors for Validation type: " + validationType);
+	    sb.append("+++++++++++++++++++++++++++++++++++++++++++++++++++");
+	    final List<String> errors = result.getErrors().get(validationType);
+	    for (String err : errors) {
 		sb.append(err);
 		if (sb.length() > 0) {
 		    sb.append("\n");
 		}
 	    }
-	    if (sb.length() > 0) {
-		throw new OBException(sb.toString());
-	    }
-	} else {
-	    for (String err : result.getErrors()) {
-		log.error(err);
-	    }
+	}
+	log.error(sb.toString());
+	if (failOnError) {
+	    throw new OBException(sb.toString());
 	}
     }