[DynamicRebuildWindow]Merge with pi
authorAntonio Moreno <antonio.moreno@openbravo.com>
Mon, 03 May 2010 18:42:20 +0200
changeset 7519 432ccd399d73
parent 7518 75183bb88d94 (current diff)
parent 7223 0543830780dd (diff)
child 7520 896cbca4578c
[DynamicRebuildWindow]Merge with pi
build.xml
src-db/database/model/triggers/AD_MODULE_TRANSLATION_TRG.xml
src-db/database/model/triggers/C_INVOICELINE_TRG4.xml
src-wad/build.xml
--- a/build.xml	Mon May 03 17:27:10 2010 +0200
+++ b/build.xml	Mon May 03 18:42:20 2010 +0200
@@ -353,7 +353,7 @@
                            property="test.md5.wad"/>
   </target>
 
-  <target name="compile.complete.development" depends="init" if="mode.class">
+  <target name="compile.complete.development" depends="init" unless="mode.war">
     <ant dir="${base.src}" target="compile.complete.development" inheritAll="true" inheritRefs="true" />
   </target>
 
@@ -365,7 +365,7 @@
   <target name="compile.deploy" depends="compile.war, compile.development">
   </target>
 
-  <target name="compile.development" depends="init" if="mode.class">
+  <target name="compile.development" depends="init" unless="mode.war">
     <ant dir="${base.src}" target="compile.development" inheritAll="true" inheritRefs="true" />
   </target>
 
@@ -378,6 +378,7 @@
   </target>
 
   <target name="compile.war" if="mode.war">
+    <antcall target="generate.entities" />
     <antcall target="compile" />
     <antcall target="war" />
   </target>
Binary file src-db/database/lib/dbsourcemanager.jar has changed
--- a/src-db/database/model/functions/MA_PRODUCTIONRUN_STANDARD.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src-db/database/model/functions/MA_PRODUCTIONRUN_STANDARD.xml	Mon May 03 18:42:20 2010 +0200
@@ -55,6 +55,7 @@
     v_PlanLine NUMBER;
     v_CostCenterCost NUMBER;
     v_CostCenterUse NUMBER;
+    v_allownegativestock CHAR(1);
     v_Calculated CHAR(1);
     v_ByDefault CHAR(1);
     --  Toolset Types to process
@@ -117,6 +118,11 @@
         DBMS_OUTPUT.PUT_LINE('--<<MA_ProductionRun_Standard>>') ;
       END IF;
     BEGIN --BODY
+     SELECT ad_clientinfo.allownegativestock into
+      v_allownegativestock
+       FROM ad_clientinfo
+      where ad_clientinfo.ad_client_id = v_Client_ID;
+      
       v_ResultStr:='Getting DoneQuantity and process_ID';
       SELECT M_ProductionPlan.AD_Org_ID, M_ProductionPlan.MA_WRPhase_ID,
              M_ProductionPlan.ProductionQty, M_ProductionPlan.Processed,
@@ -336,8 +342,55 @@
               END LOOP;
             END IF; --NEXT_PRODUCT
             IF (v_QtyAcumulated < v_DoneQuantity*Cur_WRPUsed.MovementQty) THEN
-              v_Message := '@NotEnoughStocked@: ' || Cur_WRPUsed.pname;
-            RAISE_APPLICATION_ERROR(-20000, v_Message);
+            	IF(v_allownegativestock = 'Y') THEN
+            		 IF(v_GlobalUse='Y') THEN
+	            		 SELECT count(*)
+	            		    INTO v_Count
+	                		FROM MA_GlobalUse
+	                		WHERE M_Production_ID=Cur_WRPUsed.M_Production_ID
+	                  		AND M_Product_ID=Cur_WRPUsed.M_Product_ID;
+	            		 IF(v_Count=0) THEN
+                        	INSERT
+			                  INTO MA_GlobalUse
+			                    (
+			                      MA_GlobalUse_ID, M_Production_ID, AD_Client_ID, AD_Org_ID,
+			                      IsActive, Created, CreatedBy, Updated,
+			                      UpdatedBy, M_Product_ID, C_UOM_ID, MovementQty,
+			                      M_Locator_ID
+			                    )
+			                    VALUES
+			                    (
+			                      GET_UUID(), Cur_WRPUsed.M_Production_ID, Cur_WRPUsed.Client_ID, Cur_WRPUsed.Org_ID,
+			                       'Y', now(), v_User_ID, now(),
+			                      v_User_ID, Cur_WRPUsed.M_Product_ID, Cur_WRPUsed.C_UOM_ID, 0,
+			                      Cur_WRPUsed.M_Locator_ID
+			                    )
+			                    ;
+                        END IF;
+	                 ELSE
+                        v_Line := v_Line + 10;
+		                INSERT
+		                INTO M_ProductionLine
+		                  (
+		                    M_ProductionLine_ID, M_ProductionPlan_ID, Line, AD_Client_ID,
+		                    AD_Org_ID, IsActive, Created, CreatedBy,
+		                    Updated, UpdatedBy, M_Product_ID, MovementQty,
+		                    ProductionType, C_UOM_ID, M_Locator_ID, M_Product_UOM_ID, QuantityOrder
+		                  )
+		                  VALUES
+		                  (
+		                    GET_UUID(), v_Record_ID, v_Line, Cur_WRPUsed.Client_ID,
+		                    Cur_WRPUsed.Org_ID, 'Y', now(), v_User_ID,
+		                    now(), v_User_ID, Cur_WRPUsed.M_Product_ID,( CASE v_NoQty WHEN 'Y' THEN 0 ELSE v_DoneQuantity*Cur_WRPUsed.MovementQty - v_QtyAcumulated END),
+		                    '-', Cur_WRPUsed.C_UOM_ID, Cur_WRPUsed.M_Locator_ID, Cur_WRPUsed.M_Product_UOM_ID, Cur_WRPUsed.QuantityOrder
+		                  )
+		                  ;
+                     END IF;
+            		
+            	ELSE
+		            v_Message := '@NotEnoughStocked@: ' || Cur_WRPUsed.pname;
+		            RAISE_APPLICATION_ERROR(-20000, v_Message);
+            	END IF;
             END IF;
           ELSE
             IF Cur_WRPUsed.M_Locator_ID IS NULL THEN
--- a/src-db/database/model/triggers/AD_MODULE_TRANSLATION_TRG.xml	Mon May 03 17:27:10 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-<?xml version="1.0"?>
-  <database name="TRIGGER AD_MODULE_TRANSLATION_TRG">
-    <trigger name="AD_MODULE_TRANSLATION_TRG" table="AD_MODULE" fires="before" insert="false" update="true" delete="false" foreach="row">
-      <body><![CDATA[
-
-/*************************************************************************
-* The contents of this file are subject to the Openbravo  Public  License
-* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
-* Version 1.1  with a permitted attribution clause; you may not  use this
-* file except in compliance with the License. You  may  obtain  a copy of
-* the License at http://www.openbravo.com/legal/license.html
-* Software distributed under the License  is  distributed  on  an "AS IS"
-* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-* License for the specific  language  governing  rights  and  limitations
-* under the License.
-* The Original Code is Openbravo ERP.
-* The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2009 Openbravo SLU
-* All Rights Reserved.
-* Contributor(s):  ______________________________________.
-************************************************************************/
-  v_Aux NUMBER;
-    
-BEGIN
-    
-    IF AD_isTriggerEnabled()='N' THEN RETURN;
-    END IF;
-
-    SELECT COUNT(*)
-      INTO v_Aux
-    FROM AD_WINDOW T
-   WHERE T.AD_MODULE_ID = :new.AD_MODULE_ID;
-
-     IF v_Aux > 0 AND :new.istranslationrequired='N' THEN
-       RAISE_APPLICATION_ERROR(-20103, 'The module has User Interface artifacts, translation required must be set to Yes (checked).') ;
-     END IF;
-
-    SELECT COUNT(*)
-      INTO v_Aux
-    FROM AD_TAB T
-   WHERE T.AD_MODULE_ID = :new.AD_MODULE_ID;
-
-     IF v_Aux > 0 AND :new.istranslationrequired='N' THEN
-       RAISE_APPLICATION_ERROR(-20103, 'The module has User Interface artifacts, translation required must be set to Yes (checked).') ;
-     END IF;
-
-    SELECT COUNT(*)
-      INTO v_Aux
-    FROM AD_FIELD T
-   WHERE T.AD_MODULE_ID = :new.AD_MODULE_ID;
-
-     IF v_Aux > 0 AND :new.istranslationrequired='N' THEN
-       RAISE_APPLICATION_ERROR(-20103, 'The module has User Interface artifacts, translation required must be set to Yes (checked).') ;
-     END IF;
-
-    SELECT COUNT(*)
-      INTO v_Aux
-    FROM AD_ELEMENT T
-   WHERE T.AD_MODULE_ID = :new.AD_MODULE_ID;
-
-     IF v_Aux > 0 AND :new.istranslationrequired='N' THEN
-       RAISE_APPLICATION_ERROR(-20103, 'The module has User Interface artifacts, translation required must be set to Yes (checked).') ;
-     END IF;
-
-    SELECT COUNT(*)
-      INTO v_Aux
-    FROM AD_TEXTINTERFACES T
-   WHERE T.AD_MODULE_ID = :new.AD_MODULE_ID;
-
-     IF v_Aux > 0 AND :new.istranslationrequired='N' THEN
-       RAISE_APPLICATION_ERROR(-20103, 'The module has User Interface artifacts, translation required must be set to Yes (checked).') ;
-     END IF;
-
-    SELECT COUNT(*)
-      INTO v_Aux
-    FROM AD_MESSAGE T
-   WHERE T.AD_MODULE_ID = :new.AD_MODULE_ID;
-
-     IF v_Aux > 0 AND :new.istranslationrequired='N' THEN
-       RAISE_APPLICATION_ERROR(-20103, 'The module has User Interface artifacts, translation required must be set to Yes (checked).') ;
-     END IF;
-
-    SELECT COUNT(*)
-      INTO v_Aux
-    FROM AD_FORM T
-   WHERE T.AD_MODULE_ID = :new.AD_MODULE_ID;
-
-     IF v_Aux > 0 AND :new.istranslationrequired='N' THEN
-       RAISE_APPLICATION_ERROR(-20103, 'The module has User Interface artifacts, translation required must be set to Yes (checked).') ;
-     END IF;
-
-    SELECT COUNT(*)
-      INTO v_Aux
-    FROM AD_MENU T
-   WHERE T.AD_MODULE_ID = :new.AD_MODULE_ID;
-
-     IF v_Aux > 0 AND :new.istranslationrequired='N' THEN
-       RAISE_APPLICATION_ERROR(-20103, 'The module has User Interface artifacts, translation required must be set to Yes (checked).') ;
-     END IF;
-
-    SELECT COUNT(*)
-      INTO v_Aux
-    FROM AD_WORKFLOW T
-   WHERE T.AD_MODULE_ID = :new.AD_MODULE_ID;
-
-     IF v_Aux > 0 AND :new.istranslationrequired='N' THEN
-       RAISE_APPLICATION_ERROR(-20103, 'The module has User Interface artifacts, translation required must be set to Yes (checked).') ;
-     END IF;
-
-END AD_MODULE_TRANSLATION_TRG
-]]></body>
-    </trigger>
-  </database>
--- a/src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml	Mon May 03 18:42:20 2010 +0200
@@ -18,7 +18,7 @@
     * under the License.
     * The Original Code is Openbravo ERP.
     * The Initial Developer of the Original Code is Openbravo SLU
-    * All portions are Copyright (C) 2001-2009 Openbravo SLU
+    * All portions are Copyright (C) 2001-2010 Openbravo SLU
     * All Rights Reserved.
     * Contributor(s):  ______________________________________.
     ************************************************************************/
@@ -79,6 +79,10 @@
     WHERE C_CURRENCY_ID=v_Currency;
     :NEW.LineNetAmt:=ROUND(:NEW.LineNetAmt, v_Prec) ;
     :NEW.ChargeAmt:=ROUND(:NEW.ChargeAmt, v_Prec) ;
+
+    IF (ROUND(TO_NUMBER(:NEW.QTYINVOICED) * TO_NUMBER(:NEW.PRICEACTUAL),v_Prec)!=TO_NUMBER(:NEW.LINENETAMT)) THEN
+      RAISE_APPLICATION_ERROR(-20000, '@LineAmountNotCorrect@') ;
+    END IF;
   END IF;
 END C_INVLINE_CHK_RESTRICTIONS_TRG
 ]]></body>
--- a/src-db/database/model/triggers/C_INVOICELINE_TRG4.xml	Mon May 03 17:27:10 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-  <database name="TRIGGER C_INVOICELINE_TRG4">
-    <trigger name="C_INVOICELINE_TRG4" table="C_INVOICELINE" fires="before" insert="true" update="true" delete="false" foreach="row">
-      <body><![CDATA[
-  /*************************************************************************
-  * The contents of this file are subject to the Openbravo  Public  License
-  * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
-  * Version 1.1  with a permitted attribution clause; you may not  use this
-  * file except in compliance with the License. You  may  obtain  a copy of
-  * the License at http://www.openbravo.com/legal/license.html
-  * Software distributed under the License  is  distributed  on  an "AS IS"
-  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-  * License for the specific  language  governing  rights  and  limitations
-  * under the License.
-  * The Original Code is Openbravo ERP.
-  * The Initial Developer of the Original Code is Openbravo SLU
-  * All portions are Copyright (C) 2010 Openbravo SLU
-  * All Rights Reserved.
-  * Contributor(s):  ______________________________________.
-  ************************************************************************/
-  V_PRECISION NUMBER;
-BEGIN
-
-  IF AD_isTriggerEnabled()='N' THEN RETURN;
-  END IF;
-
-  IF(INSERTING OR UPDATING) THEN
-    SELECT C.STDPRECISION INTO V_PRECISION FROM C_INVOICE I, C_CURRENCY C 
-    WHERE I.C_CURRENCY_ID=C.C_CURRENCY_ID 
-    AND I.C_INVOICE_ID=:NEW.C_INVOICE_ID;
- 
-    IF (ROUND(TO_NUMBER(:NEW.QTYINVOICED) * TO_NUMBER(:NEW.PRICEACTUAL),V_PRECISION)!=TO_NUMBER(:NEW.LINENETAMT)) THEN
-      RAISE_APPLICATION_ERROR(-20501,'Line Amount Is Not Correct');
-    END IF;
-  END IF;
-  END C_INVOICELINE_TRG4
-]]></body>
-    </trigger>
-  </database>
--- a/src-db/database/model/triggers/C_INVOICE_REVERSE_TRG.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src-db/database/model/triggers/C_INVOICE_REVERSE_TRG.xml	Mon May 03 18:42:20 2010 +0200
@@ -19,7 +19,7 @@
     * under the License.
     * The Original Code is Openbravo ERP.
     * The Initial Developer of the Original Code is Openbravo SLU
-    * All portions are Copyright (C) 2009 Openbravo SLU
+    * All portions are Copyright (C) 2009-2010 Openbravo SLU
     * All Rights Reserved.
     * Contributor(s):  ______________________________________.
     ************************************************************************/
@@ -30,15 +30,18 @@
    v_isprocessed C_Invoice.Processed%TYPE;
    v_bpheader_id C_Invoice.C_BPARTNER_ID%TYPE;
    v_bpreversed_id C_Invoice.C_BPARTNER_ID%TYPE;
-   
+   v_docstatus C_Invoice.DOCSTATUS%TYPE;
+   v_isposted C_Invoice.POSTED%TYPE;
+   v_amt C_Invoice.GrandTotal%TYPE;
+
 BEGIN
     
     IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF(INSERTING OR UPDATING) THEN
-   SELECT PROCESSED, C_BPARTNER_ID
-   INTO v_isprocessed, v_bpheader_id
+   SELECT PROCESSED, C_BPARTNER_ID, DOCSTATUS, POSTED, GRANDTOTAL
+   INTO v_isprocessed, v_bpheader_id, v_docstatus, v_isposted, v_amt
    FROM C_INVOICE
    WHERE C_INVOICE_ID=:NEW.C_INVOICE_ID;
    
@@ -47,8 +50,20 @@
    FROM C_INVOICE
    WHERE C_INVOICE_ID=:NEW.REVERSED_C_INVOICE_ID;
    
-   IF(v_isprocessed='Y') THEN
-     RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+   IF ((v_isposted='Y') OR (v_isprocessed='Y' AND v_docstatus<>'VO')) THEN
+     RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
+   END IF;
+
+   IF (UPDATING) THEN 
+       IF (v_isprocessed='Y' AND v_docstatus='VO' AND :NEW.REVERSED_C_INVOICE_ID <> :OLD.REVERSED_C_INVOICE_ID) THEN
+         RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
+       END IF;
+   END IF;
+
+   IF (INSERTING) THEN 
+       IF (v_isprocessed='Y' AND v_docstatus='VO' AND v_amt > 0) THEN
+         RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
+       END IF;
    END IF;
    
    IF(v_bpheader_id <> v_bpreversed_id) THEN
@@ -57,13 +72,17 @@
   END IF;
   
   IF(DELETING) THEN
-   SELECT PROCESSED
-   INTO v_isprocessed
+   SELECT PROCESSED, POSTED, DOCSTATUS, GRANDTOTAL
+   INTO v_isprocessed, v_isposted, v_docstatus, v_amt
    FROM C_INVOICE
    WHERE C_INVOICE_ID=:OLD.C_INVOICE_ID;
    
-   IF(v_isprocessed='Y') THEN
-     RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+   IF((v_isposted='Y') OR (v_isprocessed='Y' AND v_docstatus<>'VO')) THEN
+     RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
+   END IF;
+
+   IF (v_isprocessed='Y' AND v_docstatus='VO' AND v_amt > 0) THEN
+      RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
    END IF;
    
   END IF;
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Mon May 03 18:42:20 2010 +0200
@@ -289690,7 +289690,6 @@
 <!--828EE0AE7FEC5FA1E040007F010067C7-->  <COLUMNNAME><![CDATA[AD_Org_ID]]></COLUMNNAME>
 <!--828EE0AE7FEC5FA1E040007F010067C7-->  <AD_TABLE_ID><![CDATA[AC389EBD8A774AAE8223A77F692983D8]]></AD_TABLE_ID>
 <!--828EE0AE7FEC5FA1E040007F010067C7-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
-<!--828EE0AE7FEC5FA1E040007F010067C7-->  <AD_VAL_RULE_ID><![CDATA[104]]></AD_VAL_RULE_ID>
 <!--828EE0AE7FEC5FA1E040007F010067C7-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
 <!--828EE0AE7FEC5FA1E040007F010067C7-->  <DEFAULTVALUE><![CDATA[@AD_ORG_ID@]]></DEFAULTVALUE>
 <!--828EE0AE7FEC5FA1E040007F010067C7-->  <ISKEY><![CDATA[N]]></ISKEY>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Mon May 03 18:42:20 2010 +0200
@@ -194155,7 +194155,7 @@
 <!--7C541AC0C75FFDD7E040007F01016B4D-->  <AD_COLUMN_ID><![CDATA[8A6DE2B41CB440B7B9C36C9C149192F7]]></AD_COLUMN_ID>
 <!--7C541AC0C75FFDD7E040007F01016B4D-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--7C541AC0C75FFDD7E040007F01016B4D-->  <DISPLAYLENGTH><![CDATA[255]]></DISPLAYLENGTH>
-<!--7C541AC0C75FFDD7E040007F01016B4D-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--7C541AC0C75FFDD7E040007F01016B4D-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--7C541AC0C75FFDD7E040007F01016B4D-->  <SEQNO><![CDATA[60]]></SEQNO>
 <!--7C541AC0C75FFDD7E040007F01016B4D-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--7C541AC0C75FFDD7E040007F01016B4D-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
@@ -196632,287 +196632,6 @@
 <!--8046279CCA5D981BE040007F01013FDA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--8046279CCA5D981BE040007F01013FDA--></AD_FIELD>
 
-<!--804882C210BE3922E040007F01004FC0--><AD_FIELD>
-<!--804882C210BE3922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210BE3922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210BE3922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210BE3922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210BE3922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210BE3922E040007F01004FC0-->  <NAME><![CDATA[Client]]></NAME>
-<!--804882C210BE3922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
-<!--804882C210BE3922E040007F01004FC0-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
-<!--804882C210BE3922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210BE3922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210BE3922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0ED1126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210BE3922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210BE3922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210BE3922E040007F01004FC0-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
-<!--804882C210BE3922E040007F01004FC0-->  <SEQNO><![CDATA[10]]></SEQNO>
-<!--804882C210BE3922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210BE3922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210BE3922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210BE3922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
-<!--804882C210BE3922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210BE3922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210BE3922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210BF3922E040007F01004FC0--><AD_FIELD>
-<!--804882C210BF3922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210BF3922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210BF3922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210BF3922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210BF3922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210BF3922E040007F01004FC0-->  <NAME><![CDATA[Organization]]></NAME>
-<!--804882C210BF3922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
-<!--804882C210BF3922E040007F01004FC0-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
-<!--804882C210BF3922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210BF3922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210BF3922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0EE1126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210BF3922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210BF3922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210BF3922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210BF3922E040007F01004FC0-->  <SEQNO><![CDATA[20]]></SEQNO>
-<!--804882C210BF3922E040007F01004FC0-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
-<!--804882C210BF3922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210BF3922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210BF3922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
-<!--804882C210BF3922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210BF3922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210BF3922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C03922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C03922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C03922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C03922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C03922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C03922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C03922E040007F01004FC0-->  <NAME><![CDATA[Accounting Schema]]></NAME>
-<!--804882C210C03922E040007F01004FC0-->  <DESCRIPTION><![CDATA[The structure used in accounting including costing methods, currencies, and the calendar.]]></DESCRIPTION>
-<!--804882C210C03922E040007F01004FC0-->  <HELP><![CDATA[An Accounting Schema defines the rules used in accounting such as costing method, currency and calendar]]></HELP>
-<!--804882C210C03922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C03922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C03922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0EC1126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C03922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210C03922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210C03922E040007F01004FC0-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
-<!--804882C210C03922E040007F01004FC0-->  <SEQNO><![CDATA[30]]></SEQNO>
-<!--804882C210C03922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C03922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C03922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C03922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--804882C210C03922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C03922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C03922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C13922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C13922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C13922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C13922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C13922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C13922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C13922E040007F01004FC0-->  <NAME><![CDATA[Credit Account]]></NAME>
-<!--804882C210C13922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Credit Account used by the financial account]]></DESCRIPTION>
-<!--804882C210C13922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C13922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C13922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0F91126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C13922E040007F01004FC0-->  <AD_FIELDGROUP_ID><![CDATA[1F959EBBBFF64AA18E975D1AD70C1588]]></AD_FIELDGROUP_ID>
-<!--804882C210C13922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210C13922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210C13922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210C13922E040007F01004FC0-->  <SEQNO><![CDATA[140]]></SEQNO>
-<!--804882C210C13922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C13922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C13922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C13922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--804882C210C13922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C13922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C13922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C23922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C23922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C23922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C23922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C23922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C23922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C23922E040007F01004FC0-->  <NAME><![CDATA[Debit Account]]></NAME>
-<!--804882C210C23922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Debit Account used by the financial account]]></DESCRIPTION>
-<!--804882C210C23922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C23922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C23922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0F81126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C23922E040007F01004FC0-->  <AD_FIELDGROUP_ID><![CDATA[1F959EBBBFF64AA18E975D1AD70C1588]]></AD_FIELDGROUP_ID>
-<!--804882C210C23922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210C23922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210C23922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210C23922E040007F01004FC0-->  <SEQNO><![CDATA[130]]></SEQNO>
-<!--804882C210C23922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C23922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C23922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C23922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--804882C210C23922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C23922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C23922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C33922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C33922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C33922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C33922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C33922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C33922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C33922E040007F01004FC0-->  <NAME><![CDATA[Deposit Account]]></NAME>
-<!--804882C210C33922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Deposit Account used by the financial account]]></DESCRIPTION>
-<!--804882C210C33922E040007F01004FC0-->  <HELP><![CDATA[Deposit Account used by the financial account]]></HELP>
-<!--804882C210C33922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C33922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C33922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0F61126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C33922E040007F01004FC0-->  <AD_FIELDGROUP_ID><![CDATA[392B1D87375D422F920E4DA159A86385]]></AD_FIELDGROUP_ID>
-<!--804882C210C33922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210C33922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210C33922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210C33922E040007F01004FC0-->  <SEQNO><![CDATA[110]]></SEQNO>
-<!--804882C210C33922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C33922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C33922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C33922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--804882C210C33922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C33922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C33922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C43922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C43922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C43922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C43922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C43922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C43922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C43922E040007F01004FC0-->  <NAME><![CDATA[Financial Account Accounts]]></NAME>
-<!--804882C210C43922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Financial Account Accounts]]></DESCRIPTION>
-<!--804882C210C43922E040007F01004FC0-->  <HELP><![CDATA[Financial Account Accounts]]></HELP>
-<!--804882C210C43922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C43922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C43922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0EA1126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C43922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
-<!--804882C210C43922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210C43922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210C43922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C43922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C43922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C43922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
-<!--804882C210C43922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C43922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C43922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C53922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C53922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C53922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C53922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C53922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C53922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C53922E040007F01004FC0-->  <NAME><![CDATA[Financial Account]]></NAME>
-<!--804882C210C53922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Financial account used to deposit / withdrawal money such as bank accounts or petty cash]]></DESCRIPTION>
-<!--804882C210C53922E040007F01004FC0-->  <HELP><![CDATA[Financial account used to deposit / withdrawal money such as bank accounts or petty cash]]></HELP>
-<!--804882C210C53922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C53922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C53922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0EB1126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C53922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210C53922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210C53922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210C53922E040007F01004FC0-->  <SEQNO><![CDATA[40]]></SEQNO>
-<!--804882C210C53922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C53922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C53922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C53922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--804882C210C53922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C53922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C53922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C63922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C63922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C63922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C63922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C63922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C63922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C63922E040007F01004FC0-->  <NAME><![CDATA[Make Payment Account]]></NAME>
-<!--804882C210C63922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Make Payment Account used by financial account]]></DESCRIPTION>
-<!--804882C210C63922E040007F01004FC0-->  <HELP><![CDATA[Make Payment Account used by financial account]]></HELP>
-<!--804882C210C63922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C63922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C63922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0F51126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C63922E040007F01004FC0-->  <AD_FIELDGROUP_ID><![CDATA[1714098AD15E4B4692378950DEDD1FA4]]></AD_FIELDGROUP_ID>
-<!--804882C210C63922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210C63922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210C63922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210C63922E040007F01004FC0-->  <SEQNO><![CDATA[100]]></SEQNO>
-<!--804882C210C63922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C63922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C63922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C63922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--804882C210C63922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C63922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C63922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C73922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C73922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C73922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C73922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C73922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C73922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C73922E040007F01004FC0-->  <NAME><![CDATA[Receive Payment Account]]></NAME>
-<!--804882C210C73922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Receive Payment Account used by financial account]]></DESCRIPTION>
-<!--804882C210C73922E040007F01004FC0-->  <HELP><![CDATA[Receive Payment Account used by financial account]]></HELP>
-<!--804882C210C73922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C73922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C73922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0F41126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C73922E040007F01004FC0-->  <AD_FIELDGROUP_ID><![CDATA[1714098AD15E4B4692378950DEDD1FA4]]></AD_FIELDGROUP_ID>
-<!--804882C210C73922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210C73922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210C73922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210C73922E040007F01004FC0-->  <SEQNO><![CDATA[90]]></SEQNO>
-<!--804882C210C73922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C73922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C73922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C73922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--804882C210C73922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C73922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C73922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C83922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C83922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C83922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C83922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C83922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C83922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C83922E040007F01004FC0-->  <NAME><![CDATA[Withdrawal Account]]></NAME>
-<!--804882C210C83922E040007F01004FC0-->  <DESCRIPTION><![CDATA[Withdrawal Account used by the financial account]]></DESCRIPTION>
-<!--804882C210C83922E040007F01004FC0-->  <HELP><![CDATA[Withdrawal Account used by the financial account]]></HELP>
-<!--804882C210C83922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C83922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C83922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0F71126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C83922E040007F01004FC0-->  <AD_FIELDGROUP_ID><![CDATA[392B1D87375D422F920E4DA159A86385]]></AD_FIELDGROUP_ID>
-<!--804882C210C83922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210C83922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--804882C210C83922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210C83922E040007F01004FC0-->  <SEQNO><![CDATA[120]]></SEQNO>
-<!--804882C210C83922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C83922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C83922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C83922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--804882C210C83922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C83922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C83922E040007F01004FC0--></AD_FIELD>
-
-<!--804882C210C93922E040007F01004FC0--><AD_FIELD>
-<!--804882C210C93922E040007F01004FC0-->  <AD_FIELD_ID><![CDATA[804882C210C93922E040007F01004FC0]]></AD_FIELD_ID>
-<!--804882C210C93922E040007F01004FC0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--804882C210C93922E040007F01004FC0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--804882C210C93922E040007F01004FC0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--804882C210C93922E040007F01004FC0-->  <NAME><![CDATA[Active]]></NAME>
-<!--804882C210C93922E040007F01004FC0-->  <DESCRIPTION><![CDATA[A flag indicating whether this record is available for use or de-activated.]]></DESCRIPTION>
-<!--804882C210C93922E040007F01004FC0-->  <HELP><![CDATA[There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reporting. There are two reasons for de-activating and not deleting records: 
-(1) The system requires the record for auditing purposes.
-(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are existing invoices for it. By de-activating the Business Partner you prevent it from being used in future transactions.]]></HELP>
-<!--804882C210C93922E040007F01004FC0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--804882C210C93922E040007F01004FC0-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--804882C210C93922E040007F01004FC0-->  <AD_COLUMN_ID><![CDATA[804880D7B0EF1126E040007F01004F9E]]></AD_COLUMN_ID>
-<!--804882C210C93922E040007F01004FC0-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--804882C210C93922E040007F01004FC0-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
-<!--804882C210C93922E040007F01004FC0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--804882C210C93922E040007F01004FC0-->  <SEQNO><![CDATA[50]]></SEQNO>
-<!--804882C210C93922E040007F01004FC0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--804882C210C93922E040007F01004FC0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--804882C210C93922E040007F01004FC0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--804882C210C93922E040007F01004FC0-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--804882C210C93922E040007F01004FC0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--804882C210C93922E040007F01004FC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--804882C210C93922E040007F01004FC0--></AD_FIELD>
-
 <!--80582217C7470114E040007F0101799A--><AD_FIELD>
 <!--80582217C7470114E040007F0101799A-->  <AD_FIELD_ID><![CDATA[80582217C7470114E040007F0101799A]]></AD_FIELD_ID>
 <!--80582217C7470114E040007F0101799A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -199123,72 +198842,6 @@
 <!--841EC1ED88778475E040007F01013E31-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--841EC1ED88778475E040007F01013E31--></AD_FIELD>
 
-<!--84438C5EA78CD097E040007F01006579--><AD_FIELD>
-<!--84438C5EA78CD097E040007F01006579-->  <AD_FIELD_ID><![CDATA[84438C5EA78CD097E040007F01006579]]></AD_FIELD_ID>
-<!--84438C5EA78CD097E040007F01006579-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--84438C5EA78CD097E040007F01006579-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--84438C5EA78CD097E040007F01006579-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--84438C5EA78CD097E040007F01006579-->  <NAME><![CDATA[Bank fee account]]></NAME>
-<!--84438C5EA78CD097E040007F01006579-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--84438C5EA78CD097E040007F01006579-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--84438C5EA78CD097E040007F01006579-->  <AD_COLUMN_ID><![CDATA[828EE0AE80025FA1E040007F010067C7]]></AD_COLUMN_ID>
-<!--84438C5EA78CD097E040007F01006579-->  <AD_FIELDGROUP_ID><![CDATA[113]]></AD_FIELDGROUP_ID>
-<!--84438C5EA78CD097E040007F01006579-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--84438C5EA78CD097E040007F01006579-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--84438C5EA78CD097E040007F01006579-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--84438C5EA78CD097E040007F01006579-->  <SEQNO><![CDATA[60]]></SEQNO>
-<!--84438C5EA78CD097E040007F01006579-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--84438C5EA78CD097E040007F01006579-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--84438C5EA78CD097E040007F01006579-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--84438C5EA78CD097E040007F01006579-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--84438C5EA78CD097E040007F01006579-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--84438C5EA78CD097E040007F01006579-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--84438C5EA78CD097E040007F01006579--></AD_FIELD>
-
-<!--84438C5EA78DD097E040007F01006579--><AD_FIELD>
-<!--84438C5EA78DD097E040007F01006579-->  <AD_FIELD_ID><![CDATA[84438C5EA78DD097E040007F01006579]]></AD_FIELD_ID>
-<!--84438C5EA78DD097E040007F01006579-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--84438C5EA78DD097E040007F01006579-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--84438C5EA78DD097E040007F01006579-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--84438C5EA78DD097E040007F01006579-->  <NAME><![CDATA[Bank revaluation gain account]]></NAME>
-<!--84438C5EA78DD097E040007F01006579-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--84438C5EA78DD097E040007F01006579-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--84438C5EA78DD097E040007F01006579-->  <AD_COLUMN_ID><![CDATA[828EE0AE80035FA1E040007F010067C7]]></AD_COLUMN_ID>
-<!--84438C5EA78DD097E040007F01006579-->  <AD_FIELDGROUP_ID><![CDATA[113]]></AD_FIELDGROUP_ID>
-<!--84438C5EA78DD097E040007F01006579-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--84438C5EA78DD097E040007F01006579-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--84438C5EA78DD097E040007F01006579-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--84438C5EA78DD097E040007F01006579-->  <SEQNO><![CDATA[70]]></SEQNO>
-<!--84438C5EA78DD097E040007F01006579-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--84438C5EA78DD097E040007F01006579-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--84438C5EA78DD097E040007F01006579-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--84438C5EA78DD097E040007F01006579-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--84438C5EA78DD097E040007F01006579-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--84438C5EA78DD097E040007F01006579-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--84438C5EA78DD097E040007F01006579--></AD_FIELD>
-
-<!--84438C5EA78ED097E040007F01006579--><AD_FIELD>
-<!--84438C5EA78ED097E040007F01006579-->  <AD_FIELD_ID><![CDATA[84438C5EA78ED097E040007F01006579]]></AD_FIELD_ID>
-<!--84438C5EA78ED097E040007F01006579-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--84438C5EA78ED097E040007F01006579-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--84438C5EA78ED097E040007F01006579-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--84438C5EA78ED097E040007F01006579-->  <NAME><![CDATA[Bank revaluation loss account]]></NAME>
-<!--84438C5EA78ED097E040007F01006579-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--84438C5EA78ED097E040007F01006579-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--84438C5EA78ED097E040007F01006579-->  <AD_COLUMN_ID><![CDATA[828EE0AE80045FA1E040007F010067C7]]></AD_COLUMN_ID>
-<!--84438C5EA78ED097E040007F01006579-->  <AD_FIELDGROUP_ID><![CDATA[113]]></AD_FIELDGROUP_ID>
-<!--84438C5EA78ED097E040007F01006579-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--84438C5EA78ED097E040007F01006579-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
-<!--84438C5EA78ED097E040007F01006579-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--84438C5EA78ED097E040007F01006579-->  <SEQNO><![CDATA[80]]></SEQNO>
-<!--84438C5EA78ED097E040007F01006579-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
-<!--84438C5EA78ED097E040007F01006579-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--84438C5EA78ED097E040007F01006579-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--84438C5EA78ED097E040007F01006579-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--84438C5EA78ED097E040007F01006579-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--84438C5EA78ED097E040007F01006579-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--84438C5EA78ED097E040007F01006579--></AD_FIELD>
-
 <!--845FD2B3462D4B84838E1392D7575895--><AD_FIELD>
 <!--845FD2B3462D4B84838E1392D7575895-->  <AD_FIELD_ID><![CDATA[845FD2B3462D4B84838E1392D7575895]]></AD_FIELD_ID>
 <!--845FD2B3462D4B84838E1392D7575895-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -200649,7 +200302,7 @@
 <!--C54C5ACB3B784C588EE3C7A4BDD78DF8-->  <AD_COLUMN_ID><![CDATA[8A6DE2B41CB440B7B9C36C9C149192F7]]></AD_COLUMN_ID>
 <!--C54C5ACB3B784C588EE3C7A4BDD78DF8-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--C54C5ACB3B784C588EE3C7A4BDD78DF8-->  <DISPLAYLENGTH><![CDATA[255]]></DISPLAYLENGTH>
-<!--C54C5ACB3B784C588EE3C7A4BDD78DF8-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--C54C5ACB3B784C588EE3C7A4BDD78DF8-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--C54C5ACB3B784C588EE3C7A4BDD78DF8-->  <SEQNO><![CDATA[50]]></SEQNO>
 <!--C54C5ACB3B784C588EE3C7A4BDD78DF8-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--C54C5ACB3B784C588EE3C7A4BDD78DF8-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Mon May 03 18:42:20 2010 +0200
@@ -16685,30 +16685,6 @@
 <!--7E8D14B5264B3E6CE040007F01010D94-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--7E8D14B5264B3E6CE040007F01010D94--></AD_MODEL_OBJECT>
 
-<!--7FF6CA0FA87FB943E040007F01002CC9--><AD_MODEL_OBJECT>
-<!--7FF6CA0FA87FB943E040007F01002CC9-->  <AD_MODEL_OBJECT_ID><![CDATA[7FF6CA0FA87FB943E040007F01002CC9]]></AD_MODEL_OBJECT_ID>
-<!--7FF6CA0FA87FB943E040007F01002CC9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--7FF6CA0FA87FB943E040007F01002CC9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--7FF6CA0FA87FB943E040007F01002CC9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--7FF6CA0FA87FB943E040007F01002CC9-->  <ACTION><![CDATA[W]]></ACTION>
-<!--7FF6CA0FA87FB943E040007F01002CC9-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--7FF6CA0FA87FB943E040007F01002CC9-->  <CLASSNAME><![CDATA[org.openbravo.erpWindows.AccountingSchema.FinancialAccountDefaults]]></CLASSNAME>
-<!--7FF6CA0FA87FB943E040007F01002CC9-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
-<!--7FF6CA0FA87FB943E040007F01002CC9-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
-<!--7FF6CA0FA87FB943E040007F01002CC9--></AD_MODEL_OBJECT>
-
-<!--7FF6CA0FA883B943E040007F01002CC9--><AD_MODEL_OBJECT>
-<!--7FF6CA0FA883B943E040007F01002CC9-->  <AD_MODEL_OBJECT_ID><![CDATA[7FF6CA0FA883B943E040007F01002CC9]]></AD_MODEL_OBJECT_ID>
-<!--7FF6CA0FA883B943E040007F01002CC9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--7FF6CA0FA883B943E040007F01002CC9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--7FF6CA0FA883B943E040007F01002CC9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--7FF6CA0FA883B943E040007F01002CC9-->  <ACTION><![CDATA[W]]></ACTION>
-<!--7FF6CA0FA883B943E040007F01002CC9-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--7FF6CA0FA883B943E040007F01002CC9-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.ComboReloads9380E9AFB1074FB98030E5549D7FF346]]></CLASSNAME>
-<!--7FF6CA0FA883B943E040007F01002CC9-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
-<!--7FF6CA0FA883B943E040007F01002CC9-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
-<!--7FF6CA0FA883B943E040007F01002CC9--></AD_MODEL_OBJECT>
-
 <!--806C812ED5B7074EE040007F0101087D--><AD_MODEL_OBJECT>
 <!--806C812ED5B7074EE040007F0101087D-->  <AD_MODEL_OBJECT_ID><![CDATA[806C812ED5B7074EE040007F0101087D]]></AD_MODEL_OBJECT_ID>
 <!--806C812ED5B7074EE040007F0101087D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Mon May 03 18:42:20 2010 +0200
@@ -25630,46 +25630,6 @@
 <!--7E8D14B5264C3E6CE040007F01010D94-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
 <!--7E8D14B5264C3E6CE040007F01010D94--></AD_MODEL_OBJECT_MAPPING>
 
-<!--7FF6CA0FA880B943E040007F01002CC9--><AD_MODEL_OBJECT_MAPPING>
-<!--7FF6CA0FA880B943E040007F01002CC9-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[7FF6CA0FA880B943E040007F01002CC9]]></AD_MODEL_OBJECT_MAPPING_ID>
-<!--7FF6CA0FA880B943E040007F01002CC9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--7FF6CA0FA880B943E040007F01002CC9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--7FF6CA0FA880B943E040007F01002CC9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--7FF6CA0FA880B943E040007F01002CC9-->  <AD_MODEL_OBJECT_ID><![CDATA[7FF6CA0FA87FB943E040007F01002CC9]]></AD_MODEL_OBJECT_ID>
-<!--7FF6CA0FA880B943E040007F01002CC9-->  <MAPPINGNAME><![CDATA[/AccountingSchema/FinancialAccountDefaults_Relation.html]]></MAPPINGNAME>
-<!--7FF6CA0FA880B943E040007F01002CC9-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
-<!--7FF6CA0FA880B943E040007F01002CC9--></AD_MODEL_OBJECT_MAPPING>
-
-<!--7FF6CA0FA881B943E040007F01002CC9--><AD_MODEL_OBJECT_MAPPING>
-<!--7FF6CA0FA881B943E040007F01002CC9-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[7FF6CA0FA881B943E040007F01002CC9]]></AD_MODEL_OBJECT_MAPPING_ID>
-<!--7FF6CA0FA881B943E040007F01002CC9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--7FF6CA0FA881B943E040007F01002CC9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--7FF6CA0FA881B943E040007F01002CC9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--7FF6CA0FA881B943E040007F01002CC9-->  <AD_MODEL_OBJECT_ID><![CDATA[7FF6CA0FA87FB943E040007F01002CC9]]></AD_MODEL_OBJECT_ID>
-<!--7FF6CA0FA881B943E040007F01002CC9-->  <MAPPINGNAME><![CDATA[/AccountingSchema/FinancialAccountDefaults_Edition.html]]></MAPPINGNAME>
-<!--7FF6CA0FA881B943E040007F01002CC9-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
-<!--7FF6CA0FA881B943E040007F01002CC9--></AD_MODEL_OBJECT_MAPPING>
-
-<!--7FF6CA0FA882B943E040007F01002CC9--><AD_MODEL_OBJECT_MAPPING>
-<!--7FF6CA0FA882B943E040007F01002CC9-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[7FF6CA0FA882B943E040007F01002CC9]]></AD_MODEL_OBJECT_MAPPING_ID>
-<!--7FF6CA0FA882B943E040007F01002CC9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--7FF6CA0FA882B943E040007F01002CC9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--7FF6CA0FA882B943E040007F01002CC9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--7FF6CA0FA882B943E040007F01002CC9-->  <AD_MODEL_OBJECT_ID><![CDATA[7FF6CA0FA87FB943E040007F01002CC9]]></AD_MODEL_OBJECT_ID>
-<!--7FF6CA0FA882B943E040007F01002CC9-->  <MAPPINGNAME><![CDATA[/AccountingSchema/FinancialAccountDefaults_Excel.xls]]></MAPPINGNAME>
-<!--7FF6CA0FA882B943E040007F01002CC9-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
-<!--7FF6CA0FA882B943E040007F01002CC9--></AD_MODEL_OBJECT_MAPPING>
-
-<!--7FF6CA0FA884B943E040007F01002CC9--><AD_MODEL_OBJECT_MAPPING>
-<!--7FF6CA0FA884B943E040007F01002CC9-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[7FF6CA0FA884B943E040007F01002CC9]]></AD_MODEL_OBJECT_MAPPING_ID>
-<!--7FF6CA0FA884B943E040007F01002CC9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--7FF6CA0FA884B943E040007F01002CC9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--7FF6CA0FA884B943E040007F01002CC9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--7FF6CA0FA884B943E040007F01002CC9-->  <AD_MODEL_OBJECT_ID><![CDATA[7FF6CA0FA883B943E040007F01002CC9]]></AD_MODEL_OBJECT_ID>
-<!--7FF6CA0FA884B943E040007F01002CC9-->  <MAPPINGNAME><![CDATA[/ad_callouts/ComboReloads9380E9AFB1074FB98030E5549D7FF346.html]]></MAPPINGNAME>
-<!--7FF6CA0FA884B943E040007F01002CC9-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
-<!--7FF6CA0FA884B943E040007F01002CC9--></AD_MODEL_OBJECT_MAPPING>
-
 <!--806C812ED5B8074EE040007F0101087D--><AD_MODEL_OBJECT_MAPPING>
 <!--806C812ED5B8074EE040007F0101087D-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[806C812ED5B8074EE040007F0101087D]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--806C812ED5B8074EE040007F0101087D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TAB.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src-db/database/sourcedata/AD_TAB.xml	Mon May 03 18:42:20 2010 +0200
@@ -13188,30 +13188,6 @@
 <!--8E5972CF3664486D9D887BDEDA88627D-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
 <!--8E5972CF3664486D9D887BDEDA88627D--></AD_TAB>
 
-<!--9380E9AFB1074FB98030E5549D7FF346--><AD_TAB>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <AD_TAB_ID><![CDATA[9380E9AFB1074FB98030E5549D7FF346]]></AD_TAB_ID>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <NAME><![CDATA[Financial Account Defaults]]></NAME>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <DESCRIPTION><![CDATA[Default accounts for the financial accounts in this accounting schema]]></DESCRIPTION>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <HELP><![CDATA[Default accounts for the financial accounts in this accounting schema]]></HELP>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <AD_TABLE_ID><![CDATA[6F98C7AB59D3410CB828DB25D638DE2C]]></AD_TABLE_ID>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <AD_WINDOW_ID><![CDATA[125]]></AD_WINDOW_ID>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <SEQNO><![CDATA[50]]></SEQNO>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <TABLEVEL><![CDATA[1]]></TABLEVEL>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <ISINFOTAB><![CDATA[Y]]></ISINFOTAB>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <ISTRANSLATIONTAB><![CDATA[N]]></ISTRANSLATIONTAB>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <HASTREE><![CDATA[N]]></HASTREE>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <PROCESSING><![CDATA[N]]></PROCESSING>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--9380E9AFB1074FB98030E5549D7FF346-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
-<!--9380E9AFB1074FB98030E5549D7FF346--></AD_TAB>
-
 <!--99DCADEC674D4ECCB158CA5F3DDBFF83--><AD_TAB>
 <!--99DCADEC674D4ECCB158CA5F3DDBFF83-->  <AD_TAB_ID><![CDATA[99DCADEC674D4ECCB158CA5F3DDBFF83]]></AD_TAB_ID>
 <!--99DCADEC674D4ECCB158CA5F3DDBFF83-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-test/org/openbravo/test/dal/IssuesTest.java	Mon May 03 17:27:10 2010 +0200
+++ b/src-test/org/openbravo/test/dal/IssuesTest.java	Mon May 03 18:42:20 2010 +0200
@@ -85,6 +85,12 @@
  * - https://issues.openbravo.com/view.php?id=12918 DAL: Exception in commitTransaction leaves
  * Postgres connection in illegal state
  * 
+ * - https://issues.openbravo.com/view.php?id=13135: OBContext.getLanguage() returns 'wrong'
+ * language, if user does not have a default language set
+ * 
+ * - https://issues.openbravo.com/view.php?id=13136: OBContext.getLanguage does only use users'
+ * default language, and does not honor language change in the role change popup
+ * 
  * @author mtaal
  * @author iperdomo
  */
@@ -357,4 +363,37 @@
     products.setFilterOnReadableClients(false);
     assertTrue(products.count() > 0);
   }
+
+  /**
+   * Tests: 13135: OBContext.getLanguage() returns 'wrong' language, if user does not have a default
+   * language set
+   */
+  public void test13135() {
+    setSystemAdministratorContext();
+
+    try {
+      final User user = OBDal.getInstance().get(User.class, "100");
+      user.setDefaultLanguage(null);
+      OBDal.getInstance().save(user);
+      final Client client = OBDal.getInstance().get(Client.class, "0");
+      client.setLanguage(OBDal.getInstance().get(Language.class, "120"));
+      OBDal.getInstance().save(client);
+
+      OBContext.setOBContext("100", "0", "0", "0", null);
+      assertEquals("120", OBContext.getOBContext().getLanguage().getId());
+
+    } finally {
+      // prevent the user to be really changed
+      OBDal.getInstance().rollbackAndClose();
+    }
+  }
+
+  /**
+   * Tests: 13136: OBContext.getLanguage does only use users' default language, and does not honor
+   * language change in the role change popup
+   */
+  public void test13136() {
+    OBContext.setOBContext("100", "0", "0", "0", "en_IN");
+    assertEquals("130", OBContext.getOBContext().getLanguage().getId());
+  }
 }
\ No newline at end of file
--- a/src-wad/src/org/openbravo/wad/WadActionButton.java	Mon May 03 17:27:10 2010 +0200
+++ b/src-wad/src/org/openbravo/wad/WadActionButton.java	Mon May 03 18:42:20 2010 +0200
@@ -597,9 +597,9 @@
                   ");\n");
         } else {
           html.append("PInstanceProcessData.insertPInstanceParam"
-              + (control.isNumericType() ? "Number" : (control.isDate() ? "Date" : ""))
-              + "(this, pinstance, \"" + data[i].seqno + "\", \"" + data[i].columnname + "\", str"
-              + Sqlc.TransformaNombreColumna(data[i].columnname)
+              + (control.isNumericType() ? "Number" : (control.isDate() ? "Date" : (control
+                  .isTime() ? "Time" : ""))) + "(this, pinstance, \"" + data[i].seqno + "\", \""
+              + data[i].columnname + "\", str" + Sqlc.TransformaNombreColumna(data[i].columnname)
               + ", vars.getClient(), vars.getOrg(), vars.getUser());\n");
         }
         vecParams.addElement(Sqlc.TransformaNombreColumna(data[i].columnname));
--- a/src-wad/src/org/openbravo/wad/WadUtility.java	Mon May 03 17:27:10 2010 +0200
+++ b/src-wad/src/org/openbravo/wad/WadUtility.java	Mon May 03 18:42:20 2010 +0200
@@ -835,9 +835,7 @@
       return "";
     }
     StringBuffer _displayLogic = new StringBuffer();
-    String element = auxControl.getData("ColumnName");
-    if (auxControl.getType().equals("Combo"))
-      element = "report" + element + "_S";
+    String element = auxControl.getReadOnlyLogicColumn();
 
     _displayLogic.append("  readOnlyLogicElement('").append(element).append("', (").append(
         displayLogic(code, vecDL, parentsFieldsData, vecAuxiliar, vecFields, windowId, vecContext))
--- a/src-wad/src/org/openbravo/wad/controls/WADControl.java	Mon May 03 17:27:10 2010 +0200
+++ b/src-wad/src/org/openbravo/wad/controls/WADControl.java	Mon May 03 18:42:20 2010 +0200
@@ -540,6 +540,10 @@
     return false;
   }
 
+  public boolean isTime() {
+    return false;
+  }
+
   public String getReference() {
     return reference;
   }
@@ -579,4 +583,11 @@
     xmlDocument.setParameter("columnName", getData("ColumnName"));
     return replaceHTML(xmlDocument.print());
   }
+
+  /**
+   * Returns the HTML element to set in the read only logic
+   */
+  public String getReadOnlyLogicColumn() {
+    return getData("columnName");
+  }
 }
--- a/src-wad/src/org/openbravo/wad/controls/WADList.java	Mon May 03 17:27:10 2010 +0200
+++ b/src-wad/src/org/openbravo/wad/controls/WADList.java	Mon May 03 18:42:20 2010 +0200
@@ -306,4 +306,8 @@
   public boolean isText() {
     return true;
   }
+
+  public String getReadOnlyLogicColumn() {
+    return "report" + getData("columnName") + "_S";
+  }
 }
--- a/src-wad/src/org/openbravo/wad/controls/WADSearch.java	Mon May 03 17:27:10 2010 +0200
+++ b/src-wad/src/org/openbravo/wad/controls/WADSearch.java	Mon May 03 18:42:20 2010 +0200
@@ -492,4 +492,8 @@
     }
     return displayLogic.toString();
   }
+
+  public String getReadOnlyLogicColumn() {
+    return getData("columnName") + "_R";
+  }
 }
--- a/src-wad/src/org/openbravo/wad/controls/WADTime.java	Mon May 03 17:27:10 2010 +0200
+++ b/src-wad/src/org/openbravo/wad/controls/WADTime.java	Mon May 03 18:42:20 2010 +0200
@@ -247,7 +247,7 @@
     return displayLogic.toString();
   }
 
-  public boolean isDate() {
+  public boolean isTime() {
     return true;
   }
 }
--- a/src-wad/src/org/openbravo/wad/validation/WADValidator_data.xsql	Mon May 03 17:27:10 2010 +0200
+++ b/src-wad/src/org/openbravo/wad/validation/WADValidator_data.xsql	Mon May 03 18:42:20 2010 +0200
@@ -111,12 +111,13 @@
            and o.classname not like m.javapackage||'.%'
            and (4=4 and m.javapackage in ('4') or to_char('Y')=to_char(?))
          union
-        select  to_char(w.name||' >> '||t.name), 'Tab' as objectType, o.classname as currentvalue, (case when w.ad_module_id='0' then 'org.openbravo.erpWindows.%' else 'org.openbravo.erpWindows.'||m.javapackage||'.%' end) as expectedvalue, m.name as moduleName 
-          from ad_model_object o, ad_window w, ad_tab t, ad_module m
+        select  to_char(w.name||' >> '||t.name), 'Tab' as objectType, o.classname as currentvalue, (case when m2.ad_module_id='0' then 'org.openbravo.erpWindows.*' else 'org.openbravo.erpWindows.'||m2.javapackage||'.%' end) as expectedvalue, m.name as moduleName 
+          from ad_model_object o, ad_window w, ad_tab t, ad_module m, ad_module m2
          where o.ad_tab_id = t.ad_tab_id
            and t.ad_window_id = w.ad_window_id
            and t.ad_module_id = m.ad_module_id
-           and o.classname not like (case when w.ad_module_id='0' then 'org.openbravo.erpWindows.%' else 'org.openbravo.erpWindows.'||m.javapackage||'.%' end)
+           and w.ad_module_id = m2.ad_module_id
+           and o.classname not like (case when m2.ad_module_id='0' then 'org.openbravo.erpWindows.%' else 'org.openbravo.erpWindows.'||m2.javapackage||'.%' end)
            and o.classname not like 'org.openbravo.erpCommon.ad_callouts.ComboReloads%'
            and (5=5 and m.javapackage in ('5') or to_char('Y')=to_char(?))
          order by 4, 2, 1
--- a/src/build.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src/build.xml	Mon May 03 18:42:20 2010 +0200
@@ -782,7 +782,7 @@
     </java>
   </target>
 
-  <target name="copy.files">
+  <target name="copy.files" if="mode.class">
     <updatesystemstatus v="RB45"/>
     <mkdir dir="${jakarta.base}/webapps/${context.name}" />
     <copy todir="${jakarta.base}/webapps/${context.name}" encoding="UTF-8">
@@ -792,18 +792,15 @@
     <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/classes" encoding="UTF-8">
       <fileset dir="${build}" />
     </copy>
+    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
+      <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
+    </copy>
   </target>
 
   <target name="compile.development" depends="generate.entities, compile, copy.files">
-    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
-    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
-    </copy>
   </target>
 
   <target name="compile.complete.development" depends="compile.complete, copy.files">
-    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" />
-    <copy todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib" file="${build.core.lib}/openbravo-core.jar" encoding="UTF-8">
-    </copy>
     <updatesystemstatus v="RB51"/>
   </target>
 
--- a/src/org/openbravo/base/secureApp/LoginUtils.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/base/secureApp/LoginUtils.java	Mon May 03 18:42:20 2010 +0200
@@ -245,7 +245,7 @@
 
     // set the obcontext
     try {
-      OBContext.setOBContext(strUserAuth, strRol, strCliente, strOrg);
+      OBContext.setOBContext(strUserAuth, strRol, strCliente, strOrg, strLanguage);
     } catch (final OBSecurityException e) {
       return false;
     }
--- a/src/org/openbravo/dal/core/OBContext.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/dal/core/OBContext.java	Mon May 03 18:42:20 2010 +0200
@@ -222,6 +222,29 @@
   }
 
   /**
+   * Creates the context using the userId, roleId, clientId, orgId and sets it in the thread (as
+   * ThreadLocal).
+   * 
+   * @param userId
+   *          the id of the user
+   * @param roleId
+   *          the id of the role under which the user is currently working
+   * @param clientId
+   *          the id of the user's client
+   * @param orgId
+   *          the ud of the user's organization
+   * @param languageCode
+   *          the selected language, if null then the user language is read.
+   */
+  public static void setOBContext(String userId, String roleId, String clientId, String orgId,
+      String languageCode) {
+    final OBContext context = OBProvider.getInstance().get(OBContext.class);
+    setOBContext((OBContext) null);
+    context.initialize(userId, roleId, clientId, orgId, languageCode);
+    setOBContext(context);
+  }
+
+  /**
    * Creates the context without setting the context in the thread.
    * 
    * @param userId
@@ -505,6 +528,13 @@
 
   // sets the context by reading all user information
   public boolean initialize(String userId, String roleId, String clientId, String orgId) {
+    return initialize(userId, roleId, clientId, orgId, null);
+  }
+
+  // sets the context by reading all user information
+  private boolean initialize(String userId, String roleId, String clientId, String orgId,
+      String languageCode) {
+
     String localClientId = clientId;
     final User u = SessionHandler.getInstance().find(User.class, userId);
     if (u == null) {
@@ -614,16 +644,25 @@
       Check.isNotNull(getCurrentClient(), "Client may not be null");
       Check.isTrue(getCurrentClient().isActive(), "Current Client " + getCurrentClient().getName()
           + " is not active!");
-
-      if (getUser().getDefaultLanguage() != null && getUser().getDefaultLanguage().isActive()) {
+      if (languageCode != null) {
+        final Query qry = SessionHandler.getInstance().createQuery(
+            "select l from " + Language.class.getName() + " l where l."
+                + Language.PROPERTY_LANGUAGE + "=:languageCode ");
+        qry.setParameter("languageCode", languageCode);
+        if (qry.list().isEmpty()) {
+          throw new IllegalArgumentException("No language found for code " + languageCode);
+        }
+        setLanguage((Language) qry.list().get(0));
+      } else if (getUser().getDefaultLanguage() != null
+          && getUser().getDefaultLanguage().isActive()) {
         setLanguage(getUser().getDefaultLanguage());
+      } else if (getCurrentClient().getLanguage() != null) {
+        setLanguage(getCurrentClient().getLanguage());
       } else {
-        final Language l = getOne(Language.class, "select l from " + Language.class.getName()
-            + " l where l." + Language.PROPERTY_ACTIVE + "='Y' and systemLanguage=true order by l."
-            + Language.PROPERTY_ID + " asc");
-        Hibernate.initialize(l);
-        setLanguage(l);
+        final Client systemClient = OBDal.getInstance().get(Client.class, "0");
+        setLanguage(systemClient.getLanguage());
       }
+      Hibernate.initialize(getLanguage());
 
       Check.isNotNull(getLanguage(), "Language may not be null");
 
--- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java	Mon May 03 18:42:20 2010 +0200
@@ -75,7 +75,8 @@
       pageErrorPopUp(response);
   }
 
-  private OBError processButton(VariablesSecureApp vars, String strKey, String strOrder, String windowId) {
+  private OBError processButton(VariablesSecureApp vars, String strKey, String strOrder,
+      String windowId) {
     OBError myError = null;
     int i = 0;
     String priceactual = "";
@@ -149,6 +150,16 @@
             + ((i + 1) * 10);
         String strCOrderlineID = SequenceIdData.getUUID();
         try {
+          String isInstance = CopyFromPOOrderData.getIsInstanceValue(conn, this,
+              data[i].mAttributesetinstanceId);
+          if (isInstance != null && isInstance.equalsIgnoreCase("Y")) {
+            String strMAttributesetinstanceID = SequenceIdData.getUUID();
+            CopyFromPOOrderData.copyAttributes(conn, this, strMAttributesetinstanceID,vars.getUser(),vars.getUser(),
+                data[i].mAttributesetinstanceId);
+            CopyFromPOOrderData.copyInstances(conn, this, strMAttributesetinstanceID,vars.getUser(),vars.getUser(),
+                data[i].mAttributesetinstanceId);
+            data[i].mAttributesetinstanceId = strMAttributesetinstanceID;
+          }
           CopyFromPOOrderData.insertCOrderline(conn, this, strCOrderlineID, order[0].adClientId,
               order[0].adOrgId, vars.getUser(), strKey, Integer.toString(line),
               order[0].cBpartnerId, order[0].cBpartnerLocationId.equals("") ? ExpenseSOrderData
@@ -157,7 +168,7 @@
               order[0].mWarehouseId.equals("") ? vars.getWarehouse() : order[0].mWarehouseId,
               data[i].cUomId, data[i].qtyordered, data[i].quantityorder, data[i].cCurrencyId,
               pricelist, priceactual, pricelimit, strCTaxID, strDiscount, data[i].mProductUomId,
-              data[i].orderline);
+              data[i].orderline, data[i].mAttributesetinstanceId);
         } catch (ServletException ex) {
           myError = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
           releaseRollbackConnection(conn);
--- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder_data.xsql	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder_data.xsql	Mon May 03 18:42:20 2010 +0200
@@ -29,7 +29,7 @@
         '' AS QTYORDERED, '' AS QUANTITYORDER, '' AS M_PRODUCT_UOM_ID,
         '' as stdprecision, '' as priceprecision, '' as enforcepricelimit, '' as pricelist, '' as pricelimit, '' as validfrom,
         '' AS DESCRIPTION, '' AS PRICESTD, '' AS M_OFFER_ID, '' as orderline, O.DATEPROMISED AS DATEPROMISED, O.DATEORDERED AS DATEORDERED,
-        O.ISSOTRX AS ISSOTRX
+        O.ISSOTRX AS ISSOTRX, '' AS M_ATTRIBUTESETINSTANCE_ID 
         FROM C_ORDER O LEFT JOIN C_ORDERLINE OL ON O.C_ORDER_ID = OL.C_ORDER_ID
         WHERE O.C_ORDER_ID = ?
         GROUP BY O.C_BPARTNER_ID, O.C_BPARTNER_LOCATION_ID, O.M_WAREHOUSE_ID, O.C_CURRENCY_ID, O.C_PROJECT_ID,
@@ -43,7 +43,7 @@
     <Sql>
       <![CDATA[
         SELECT C_ORDERLINE_ID as orderline, C_UOM_ID, M_PRODUCT_ID, QTYORDERED, QUANTITYORDER,
-        M_PRODUCT_UOM_ID, DESCRIPTION, C_CURRENCY_ID
+        M_PRODUCT_UOM_ID, DESCRIPTION, C_CURRENCY_ID, M_ATTRIBUTESETINSTANCE_ID
         FROM C_ORDERLINE
         WHERE C_ORDER_ID = ?
         ORDER BY LINE ASC
@@ -61,14 +61,14 @@
         DATEORDERED, DATEPROMISED, DESCRIPTION, M_PRODUCT_ID, 
         M_WAREHOUSE_ID, C_UOM_ID, QTYORDERED, QUANTITYORDER, QTYINVOICED, QTYDELIVERED, QTYRESERVED, 
         C_CURRENCY_ID, PRICELIST, PRICEACTUAL, 
-        PRICELIMIT, C_TAX_ID, DISCOUNT, M_PRODUCT_UOM_ID, PRICESTD, M_OFFER_ID, REF_ORDERLINE_ID) 
+        PRICELIMIT, C_TAX_ID, DISCOUNT, M_PRODUCT_UOM_ID, PRICESTD, M_OFFER_ID, REF_ORDERLINE_ID, M_ATTRIBUTESETINSTANCE_ID) 
         VALUES 
           (?,?,?,TO_DATE(NOW()),?,TO_DATE(NOW()),?,
            ?,TO_NUMBER(?),?,?,
            TO_DATE(?),TO_DATE(?),?,?,
            ?,?,TO_NUMBER(?),TO_NUMBER(?),0,0,0,
            ?,TO_NUMBER(?),M_GET_OFFER_PRICE(M_GET_OFFER(TO_DATE(now()), ?, ?), TO_NUMBER(?)),
-           TO_NUMBER(?),?,TO_NUMBER(?),?,TO_NUMBER(?),M_GET_OFFER(TO_DATE(now()), ?, ?),?)
+           TO_NUMBER(?),?,TO_NUMBER(?),?,TO_NUMBER(?),M_GET_OFFER(TO_DATE(now()), ?, ?),?,?)
       ]]>
     </Sql>
     <Parameter name="cOrderlineId"/>
@@ -101,6 +101,7 @@
     <Parameter name="cBpartnerId"/>
     <Parameter name="mProductId"/>
     <Parameter name="refOrdeline"/>
+    <Parameter name="mAttributeSetInstanceId"/>
   </SqlMethod>
   <SqlMethod name="cBPartnerLocationId" type="preparedStatement" return="string">
     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
@@ -158,5 +159,55 @@
     <Parameter name="MProductID"/>
     <Parameter name="MPriceListID"/>
   </SqlMethod>
-
+  <SqlMethod name="copyAttributes" type="preparedStatement" connection="true" return="rowCount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+     INSERT INTO M_ATTRIBUTESETINSTANCE 
+       (M_ATTRIBUTESETINSTANCE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE,
+       CREATED, CREATEDBY, UPDATED, UPDATEDBY, M_ATTRIBUTESET_ID, SERNO, 
+       LOT, GUARANTEEDATE, DESCRIPTION, M_LOT_ID, ISLOCKED, LOCK_DESCRIPTION) 
+     SELECT ?, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, NOW(), ?, NOW(), 
+       ?, M_ATTRIBUTESET_ID, SERNO, LOT, GUARANTEEDATE, DESCRIPTION, 
+       M_LOT_ID, ISLOCKED, LOCK_DESCRIPTION FROM M_ATTRIBUTESETINSTANCE 
+       WHERE M_ATTRIBUTESETINSTANCE_ID = ?
+    </Sql>
+    <Parameter name="mAttributesetinstanceIdNew"/>
+    <Parameter name="createdBy"/>
+    <Parameter name="updatedBy"/>
+    <Parameter name="mAttributesetinstanceIdOld"/>
+  </SqlMethod>
+  <SqlMethod name="copyInstances" type="preparedStatement" connection="true" return="rowCount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+     INSERT INTO M_ATTRIBUTEINSTANCE
+       (M_ATTRIBUTEINSTANCE_ID, M_ATTRIBUTESETINSTANCE_ID, M_ATTRIBUTE_ID,
+       AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY,
+       M_ATTRIBUTEVALUE_ID, VALUE)
+     SELECT GET_UUID(), ?, M_ATTRIBUTE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, 
+       NOW(), ?, NOW(), ?, M_ATTRIBUTEVALUE_ID, VALUE FROM 
+       M_ATTRIBUTEINSTANCE WHERE M_ATTRIBUTESETINSTANCE_ID = ?
+   </Sql>
+    <Parameter name="mAttributesetinstanceIdNew"/>
+    <Parameter name="createdBy"/>
+    <Parameter name="updatedBy"/>
+    <Parameter name="mAttributesetinstanceIdOld"/>
+  </SqlMethod>
+  <SqlMethod name="getIsInstanceValue" type="preparedStatement" connection="true" return="string">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+		SELECT CASE WHEN M_ATTRIBUTESET.ISLOT = 'Y'
+		    OR M_ATTRIBUTESET.ISSERNO = 'Y'
+		    OR M_ATTRIBUTESET.ISGUARANTEEDATE = 'Y'
+		    OR (SELECT COUNT(*) FROM M_ATTRIBUTE, M_ATTRIBUTEINSTANCE
+		          WHERE M_ATTRIBUTEINSTANCE.M_ATTRIBUTE_ID = M_ATTRIBUTE.M_ATTRIBUTE_ID
+		          AND M_ATTRIBUTE.ISINSTANCEATTRIBUTE='Y'
+		          AND M_ATTRIBUTEINSTANCE.M_ATTRIBUTESETINSTANCE_ID = ?) > 0
+		    THEN 'Y' ELSE 'N' END AS ISINSTANCEATTRIBUTE
+		FROM M_ATTRIBUTESETINSTANCE, M_ATTRIBUTESET
+		WHERE M_ATTRIBUTESETINSTANCE.M_ATTRIBUTESET_ID = M_ATTRIBUTESET.M_ATTRIBUTESET_ID
+		AND  M_ATTRIBUTESETINSTANCE.M_ATTRIBUTESETINSTANCE_ID = ?
+   </Sql>
+    <Parameter name="mAttributesetinstanceId"/>
+    <Parameter name="mAttributesetinstanceId"/>
+  </SqlMethod>
 </SqlClass>
--- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromSettlement.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromSettlement.java	Mon May 03 18:42:20 2010 +0200
@@ -59,9 +59,9 @@
       String strDateTo = vars.getStringParameter("inpDateTo");
       String strDocumentNo = vars.getStringParameter("inpDocumentNo");
       String strDescription = vars.getStringParameter("inpDescription");
-      String strSettlement = vars.getGlobalVariable("inpcSettlementId",
-          "CopyFromSettlement|C_Settlement_ID");
-      String strWindow = vars.getStringParameter("inpwindowId");
+      String strWindow = vars.getGlobalVariable("inpwindowId", "CopyFromSettlement|Window_ID");
+      String strSettlement = vars.getGlobalVariable("inpcSettlementId", strWindow + "|"
+          + "C_Settlement_ID");
       printPage(response, vars, strDescription, strDocumentNo, strDateFrom, strDateTo,
           strSettlement, strWindow);
     } else if (vars.commandIn("FIND2")) {
@@ -309,7 +309,7 @@
     xmlDocument.setParameter("documentNo", strDocumentNo);
     xmlDocument.setData("structure", data);
     xmlDocument.setData("structure2", data2);
-    response.setContentType("text/html");
+    response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
     out.println(xmlDocument.print());
     out.close();
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Mon May 03 18:42:20 2010 +0200
@@ -604,36 +604,14 @@
             "org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO").createXmlDocument();
       if (strInvoice.equals("")) {
         if (vars.getLanguage().equals("en_US")) {
-          if (isSOTrx.equals("Y"))
+          if (isSOTrx.equals("Y")) {
             data = CreateFromShipmentData.selectFromPOSOTrx(this, vars.getLanguage(), Utility
                 .getContext(this, vars, "#User_Client", strWindowId), Utility.getContext(this,
                 vars, "#User_Org", strWindowId), strPO);
-          else {
+          } else {
             data = CreateFromShipmentData.selectFromPO(this, vars.getLanguage(), Utility
                 .getContext(this, vars, "#User_Client", strWindowId), Utility.getContext(this,
                 vars, "#User_Org", strWindowId), strPO);
-            Connection conn = null;
-            try {
-              for (int i = 0; i < data.length; i++) {
-                if (data[i].mAttributesetinstanceId != null
-                    && !"".equals(data[i].mAttributesetinstanceId)) {
-                  conn = this.getTransactionConnection();
-                  String strMAttributesetinstanceID = SequenceIdData.getUUID();
-                  CreateFromShipmentData.copyAttributes(conn, this, strMAttributesetinstanceID,
-                      data[i].mAttributesetinstanceId);
-                  CreateFromShipmentData.copyInstances(conn, this, strMAttributesetinstanceID,
-                      data[i].mAttributesetinstanceId);
-                  data[i].mAttributesetinstanceId = strMAttributesetinstanceID;
-                  releaseCommitConnection(conn);
-                }
-              }
-            } catch (Exception e) {
-              try {
-                releaseRollbackConnection(conn);
-              } catch (Exception ignored) {
-              }
-              log4j.warn("Rollback in transaction");
-            }
           }
         } else {
           if (isSOTrx.equals("Y"))
@@ -1497,9 +1475,11 @@
             price = CreateFromInvoiceData.selectPrices(conn, this, data[i].cOrderlineId);
             if (price != null && price.length > 0) {
               priceList = price[0].pricelist;
-              priceActual = price[0].priceactual;
               priceLimit = price[0].pricelimit;
               priceStd = price[0].pricestd;
+              priceActual = CreateFromInvoiceData.getOffersPriceInvoice(this, strDateInvoiced,
+            		  strBPartner, data[i].mProductId, priceStd, data[i].quantityorder,
+            		  strPriceList, strKey);
             }
             price = null;
           } else {
@@ -1507,9 +1487,11 @@
                 data[i].mProductId, strPriceListVersion);
             if (price != null && price.length > 0) {
               priceList = price[0].pricelist;
-              priceActual = price[0].priceactual;
               priceLimit = price[0].pricelimit;
               priceStd = price[0].pricestd;
+              priceActual = CreateFromInvoiceData.getOffersPriceInvoice(this, strDateInvoiced,
+            		  strBPartner, data[i].mProductId, priceStd, data[i].quantityorder,
+            		  strPriceList, strKey);
             }
             price = null;
           }
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql	Mon May 03 18:42:20 2010 +0200
@@ -602,4 +602,22 @@
     ]]></Sql>
     <Parameter name="cOrderLineId"/>
   </SqlMethod>
+  <SqlMethod name="getOffersPriceInvoice" type="preparedStatement" return="String" default="0">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      SELECT ROUND(M_GET_OFFERS_PRICE(TO_DATE(?),?,?,TO_NUMBER(?), TO_NUMBER(?), ?),
+                    (SELECT PRICEPRECISION 
+                       FROM C_CURRENCY C,
+                            C_INVOICE  I 
+                      WHERE C.C_CURRENCY_ID = I.C_CURRENCY_ID
+                        AND I.C_INVOICE_ID  = ?)) AS TOTAL FROM DUAL
+    </Sql>
+    <Parameter name="dateordered"/>
+    <Parameter name="cBpartnerId"/>
+    <Parameter name="mProductId"/>
+    <Parameter name="pricestd"/>
+    <Parameter name="qty"/>
+    <Parameter name="pricelist"/>
+    <Parameter name="invoiceid"/>
+  </SqlMethod>
 </SqlClass>
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql	Mon May 03 18:42:20 2010 +0200
@@ -515,35 +515,6 @@
     <Parameter name="mProductUomId"/>
     <Parameter name="mAttributesetinstanceId"/>
   </SqlMethod>
-  <SqlMethod name="copyAttributes" type="preparedStatement" connection="true" return="rowCount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-     INSERT INTO M_ATTRIBUTESETINSTANCE 
-       (M_ATTRIBUTESETINSTANCE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE,
-       CREATED, CREATEDBY, UPDATED, UPDATEDBY, M_ATTRIBUTESET_ID, SERNO, 
-       LOT, GUARANTEEDATE, DESCRIPTION, M_LOT_ID, ISLOCKED, LOCK_DESCRIPTION) 
-     SELECT ?, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, 
-       UPDATEDBY, M_ATTRIBUTESET_ID, SERNO, LOT, GUARANTEEDATE, DESCRIPTION, 
-       M_LOT_ID, ISLOCKED, LOCK_DESCRIPTION FROM M_ATTRIBUTESETINSTANCE 
-       WHERE M_ATTRIBUTESETINSTANCE_ID = ?
-    </Sql>
-    <Parameter name="mAttributesetinstanceIdNew"/>
-    <Parameter name="mAttributesetinstanceIdOld"/>
-  </SqlMethod>
-  <SqlMethod name="copyInstances" type="preparedStatement" connection="true" return="rowCount">
-    <SqlMethodComment></SqlMethodComment>
-    <Sql>
-     INSERT INTO M_ATTRIBUTEINSTANCE
-       (M_ATTRIBUTEINSTANCE_ID, M_ATTRIBUTESETINSTANCE_ID, M_ATTRIBUTE_ID,
-       AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY,
-       M_ATTRIBUTEVALUE_ID, VALUE)
-     SELECT GET_UUID(), ?, M_ATTRIBUTE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, 
-       CREATED, CREATEDBY, UPDATED, UPDATEDBY, M_ATTRIBUTEVALUE_ID, VALUE FROM 
-       M_ATTRIBUTEINSTANCE WHERE M_ATTRIBUTESETINSTANCE_ID = ?
-   </Sql>
-    <Parameter name="mAttributesetinstanceIdNew"/>
-    <Parameter name="mAttributesetinstanceIdOld"/>
-  </SqlMethod>
   <SqlMethod name="updateInvoice" type="preparedStatement" connection="true" return="rowCount">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_ProjectLine_Value.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_ProjectLine_Value.java	Mon May 03 18:42:20 2010 +0200
@@ -118,8 +118,8 @@
           String strCTaxID = Tax.get(this, strmProductId, strDate, strADOrgID, strMWarehouseID,
               strCBPartnerLocationID, strCBPartnerLocationID, strProjectId, strIsSOTrx.equals("Y"));
           if (strCTaxID != null && !strCTaxID.equals("")) {
-            resultado.append("new Array(\"inpcTaxId\", "
-                + (strCTaxID.equals("") ? "\"\"" : strCTaxID) + "),\n");
+            resultado.append("new Array(\"inpcTaxId\", \""
+                + (strCTaxID.equals("") ? "\"\"" : strCTaxID) + "\"),\n");
           } else
             strMessage = "TaxNotFound";
         }
--- a/src/org/openbravo/erpCommon/ad_forms/InstanceManagement.html	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/InstanceManagement.html	Mon May 03 18:42:20 2010 +0200
@@ -360,7 +360,7 @@
                   <td class="Button_LeftAlign_ContentCell" colspan="2">
                     <div>
                       <button type="button" 
-                        id="buttonScan" 
+                        id="buttonActivateOnline" 
                         class="ButtonLink" 
                         onclick="openServletNewWindow('SHOW_ACTIVATE', false, 'InstanceManagement.html', 'BUTTON', null, true, 600, 900);return false;" 
                         onfocus="buttonEvent('onfocus', this); window.status='Browse File System'; return true;" 
@@ -388,7 +388,7 @@
                   <td class="Button_LeftAlign_ContentCell" colspan="2">
                     <div>
                       <button type="button" 
-                        id="buttonScan" 
+                        id="buttonActivateLocal" 
                         class="ButtonLink" 
                         onclick="openServletNewWindow('SHOW_ACTIVATE_LOCAL', false, 'InstanceManagement.html', 'BUTTON', null, true, 600, 900);return false;" 
                         onfocus="buttonEvent('onfocus', this); window.status='Browse File System'; return true;" 
@@ -437,7 +437,7 @@
                   <td class="Button_LeftAlign_ContentCell" colspan="2">
                     <div>
                       <button type="button" 
-                        id="buttonScan" 
+                        id="buttonDeactivate" 
                         class="ButtonLink" 
                         onclick="openServletNewWindow('SHOW_DEACTIVATE', false, 'InstanceManagement.html', 'BUTTON', null, true, 600, 900);return false;" 
                         onfocus="buttonEvent('onfocus', this); window.status='Browse File System'; return true;" 
--- a/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_data.xsql	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportDebtPayment_data.xsql	Mon May 03 18:42:20 2010 +0200
@@ -35,9 +35,9 @@
       (CASE WHEN I.C_INVOICE_ID IS NULL THEN '0' ELSE I.C_INVOICE_ID END) AS C_INVOICE_ID, (CASE WHEN DP.C_DEBT_PAYMENT_ID IS NULL THEN '0' ELSE DP.C_DEBT_PAYMENT_ID END) AS C_DEBT_PAYMENT_ID, B.NAME AS BPARTNER, (CASE WHEN I.DOCUMENTNO IS NOT NULL THEN I.DOCUMENTNO||' ('||I.DATEINVOICED||')' END) AS INVOICE, DP.DATEPLANNED,
       DP.AMOUNT, DP.WRITEOFFAMT, C.ISO_CODE AS CURRENCY,
       (CASE WHEN S1.DOCUMENTNO IS NOT NULL THEN S1.DOCUMENTNO||' ('||S1.DATETRX||')' END) AS DEBTCANCEL,
-      C_CURRENCY_CONVERT(DP.AMOUNT, DP.C_CURRENCY_ID, ?, TO_DATE(I.DATEINVOICED), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS CONVAMOUNT,
-      C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM,          
-      C_CURRENCY_ISOSYM(?) AS CONVISOSYM, 
+      C_CURRENCY_CONVERT(DP.AMOUNT, DP.C_CURRENCY_ID, ?, TO_DATE(I.DATEINVOICED), NULL, I.AD_CLIENT_ID, I.AD_ORG_ID) AS CONVAMOUNT,
+      C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM,
+      C_CURRENCY_ISOSYM(?) AS CONVISOSYM,
       (CASE WHEN S2.DOCUMENTNO IS NOT NULL THEN S2.DOCUMENTNO||' ('||S2.DATETRX||')' END) AS DEBTGENERATE, COALESCE(RLT.NAME, RL.NAME) AS PAYMENTRULE,
       (CASE C_DEBT_PAYMENT_STATUS(DP.C_Settlement_Cancel_ID, DP.CANCEL_PROCESSED, DP.GENERATE_PROCESSED, DP.ISPAID, DP.ISVALID, 
       DP.C_CASHLINE_ID, DP.C_BANKSTATEMENTLINE_ID) WHEN 'I' THEN AD_MESSAGE_GET2('DPR_INVALID',?) WHEN 'C' THEN AD_MESSAGE_GET2('DPR_CONCILIATED',?) WHEN 'W' THEN AD_MESSAGE_GET2('DPR_CANCELLED',?) WHEN 'A' THEN AD_MESSAGE_GET2('DPR_SETTLE',?) WHEN 
@@ -55,9 +55,8 @@
                                                               AND RLT.AD_LANGUAGE = ?,
            AD_REF_LIST RL2    left join AD_REF_LIST_TRL RLT2 on RL2.AD_REF_LIST_ID = RLT2.AD_REF_LIST_ID
                                                               AND RLT2.AD_LANGUAGE = ?,
-           C_CURRENCY C, C_INVOICELINE
-      WHERE DP.C_CURRENCY_ID = C.C_CURRENCY_ID 
-      AND I.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+           C_CURRENCY C
+      WHERE DP.C_CURRENCY_ID = C.C_CURRENCY_ID
       AND DP.PAYMENTRULE = RL.VALUE
       AND RL.AD_REFERENCE_ID = '195'
       AND DP.STATUS = RL2.VALUE
@@ -68,7 +67,7 @@
       AND DP.IsValid='Y'
       GROUP BY (BANK.NAME || '/' || BANK.CODEBRANCH || BANK.DIGITCONTROL || BA.CODEACCOUNT || '.' || BA.DIGITCONTROL),(CASE BA.showspanish WHEN 'Y' then BA.CODEACCOUNT ELSE CASE BA.SHOWGENERIC when 'Y' then GENERICACCOUNT ELSE CASE BA.SHOWIBAN WHEN 'Y' THEN BA.IBAN END END END),
       CASE WHEN I.C_INVOICE_ID IS NULL THEN '0' ELSE I.C_INVOICE_ID END, (CASE WHEN DP.C_DEBT_PAYMENT_ID IS NULL THEN '0' ELSE DP.C_DEBT_PAYMENT_ID END), B.NAME, (CASE WHEN I.DOCUMENTNO IS NOT NULL THEN I.DOCUMENTNO||' ('||I.DATEINVOICED||')' END), DP.DATEPLANNED, 
-      DP.AMOUNT,DP.C_CURRENCY_ID, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID, I.DATEINVOICED,
+      DP.AMOUNT,DP.C_CURRENCY_ID, I.AD_CLIENT_ID, I.AD_ORG_ID, I.DATEINVOICED,
       DP.WRITEOFFAMT, C.ISO_CODE, (CASE WHEN S1.DOCUMENTNO IS NOT NULL THEN S1.DOCUMENTNO||' ('||S1.DATETRX||')' END), (CASE WHEN S2.DOCUMENTNO IS NOT NULL THEN S2.DOCUMENTNO||' ('||S2.DATETRX||')' END), RLT.NAME, RL.NAME, RLT2.NAME, RL2.NAME, DP.C_Settlement_Cancel_ID,
       DP.CANCEL_PROCESSED, DP.GENERATE_PROCESSED, DP.ISPAID, DP.ISVALID, DP.C_CASHLINE_ID, DP.C_BANKSTATEMENTLINE_ID, DP.DESCRIPTION, (CASE DP.ISRECEIPT WHEN 'Y' THEN 'SalesInvoice' ELSE 'PurchaseInvoice' END),s2.SETTLEMENTTYPE, DP.STATUS, URS.NAME
       ORDER BY 1,STATUS, DP.DATEPLANNED
@@ -112,7 +111,7 @@
       (CASE WHEN I.C_INVOICE_ID IS NULL THEN '0' ELSE I.C_INVOICE_ID END) AS C_INVOICE_ID, (CASE WHEN DP.C_DEBT_PAYMENT_ID IS NULL THEN '0' ELSE DP.C_DEBT_PAYMENT_ID END) AS C_DEBT_PAYMENT_ID, B.NAME AS BPARTNER, (CASE WHEN I.DOCUMENTNO IS NOT NULL THEN I.DOCUMENTNO||' ('||I.DATEINVOICED||')' END) AS INVOICE, DP.DATEPLANNED,
       DP.AMOUNT, DP.WRITEOFFAMT, C.ISO_CODE AS CURRENCY,
       (CASE WHEN S1.DOCUMENTNO IS NOT NULL THEN S1.DOCUMENTNO||' ('||S1.DATETRX||')' END) AS DEBTCANCEL, (CASE WHEN S2.DOCUMENTNO IS NOT NULL THEN S2.DOCUMENTNO||' ('||S2.DATETRX||')' END) AS DEBTGENERATE, COALESCE(RLT.NAME, RL.NAME) AS PAYMENTRULE,
-      C_CURRENCY_CONVERT(DP.AMOUNT, DP.C_CURRENCY_ID, ?, TO_DATE(I.DATEINVOICED), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS CONVAMOUNT,
+      C_CURRENCY_CONVERT(DP.AMOUNT, DP.C_CURRENCY_ID, ?, TO_DATE(I.DATEINVOICED), NULL, I.AD_CLIENT_ID, I.AD_ORG_ID) AS CONVAMOUNT,
       C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM,          
       C_CURRENCY_ISOSYM(?) AS CONVISOSYM, 
       (CASE C_DEBT_PAYMENT_STATUS(DP.C_Settlement_Cancel_ID, DP.CANCEL_PROCESSED, DP.GENERATE_PROCESSED, DP.ISPAID, DP.ISVALID, 
@@ -131,9 +130,8 @@
                                                               AND RLT.AD_LANGUAGE = ?,
            AD_REF_LIST RL2    left join AD_REF_LIST_TRL RLT2 on RL2.AD_REF_LIST_ID = RLT2.AD_REF_LIST_ID
                                                               AND RLT2.AD_LANGUAGE = ?,
-           C_CURRENCY C, C_INVOICELINE
+           C_CURRENCY C
       WHERE DP.C_CURRENCY_ID = C.C_CURRENCY_ID 
-      AND I.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
       AND DP.PAYMENTRULE = RL.VALUE
       AND RL.AD_REFERENCE_ID = '195'
       AND DP.STATUS = RL2.VALUE
@@ -144,7 +142,7 @@
       AND DP.IsValid='Y'
       GROUP BY (BANK.NAME || '/' || BANK.CODEBRANCH || BANK.DIGITCONTROL || BA.CODEACCOUNT || '.' || BA.DIGITCONTROL), (CASE BA.showspanish WHEN 'Y' then BA.CODEACCOUNT ELSE CASE BA.SHOWGENERIC when 'Y' then GENERICACCOUNT ELSE CASE BA.SHOWIBAN WHEN 'Y' THEN BA.IBAN END END END),
       CASE WHEN I.C_INVOICE_ID IS NULL THEN '0' ELSE I.C_INVOICE_ID END, (CASE WHEN DP.C_DEBT_PAYMENT_ID IS NULL THEN '0' ELSE DP.C_DEBT_PAYMENT_ID END), B.NAME, (CASE WHEN I.DOCUMENTNO IS NOT NULL THEN I.DOCUMENTNO||' ('||I.DATEINVOICED||')' END), DP.DATEPLANNED, DP.AMOUNT,
-      DP.C_CURRENCY_ID, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID, I.DATEINVOICED,
+      DP.C_CURRENCY_ID, I.AD_CLIENT_ID, I.AD_ORG_ID, I.DATEINVOICED,
       DP.WRITEOFFAMT, C.ISO_CODE, (CASE WHEN S1.DOCUMENTNO IS NOT NULL THEN S1.DOCUMENTNO||' ('||S1.DATETRX||')' END), (CASE WHEN S2.DOCUMENTNO IS NOT NULL THEN S2.DOCUMENTNO||' ('||S2.DATETRX||')' END), RLT.NAME, RL.NAME, RLT2.NAME, RL2.NAME, DP.C_Settlement_Cancel_ID,
       DP.CANCEL_PROCESSED, DP.GENERATE_PROCESSED, DP.ISPAID, DP.ISVALID, DP.C_CASHLINE_ID, DP.C_BANKSTATEMENTLINE_ID, DP.DESCRIPTION, (CASE DP.ISRECEIPT WHEN 'Y' THEN 'SalesInvoice' ELSE 'PurchaseInvoice' END),s2.SETTLEMENTTYPE, DP.STATUS, URS.NAME
       ORDER BY 1,STATUS, DP.DATEPLANNED
--- a/src/org/openbravo/erpCommon/ad_reports/ReportPricelist.html	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportPricelist.html	Mon May 03 18:42:20 2010 +0200
@@ -398,7 +398,7 @@
                 <div>
                   <button type="button" 
                     class="ButtonLink" 
-                    onclick="openServletNewWindow('EDIT_PDF', true, 'ReportPricelist.pdf', 'ReportPricelist', null, false, '700', '1000', true);return false;" 
+                    onclick="openServletNewWindow('EDIT_PDF', true, 'ReportPricelist.html', 'ReportPricelist', null, false, '700', '1000', true);return false;"
                     onfocus="buttonEvent('onfocus', this); window.status='Export Results to PDF Format'; return true;" 
                     onblur="buttonEvent('onblur', this);" 
                     onkeyup="buttonEvent('onkeyup', this);" 
--- a/src/org/openbravo/erpCommon/info/AccountElementValue.html	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/info/AccountElementValue.html	Mon May 03 18:42:20 2010 +0200
@@ -188,19 +188,36 @@
 				</tr>
 				<tr></tr>
 				<tr>
-					<td class="TitleCell"><span class="LabelText">Organization</span></td>
-					<td class="Combo_ContentCell" colspan="2">
-						<select class="Combo Combo_TwoCells_width required" required="true" name="inpOrganization" id="inpOrganization">
-							<option value=""></option>
-							<div id="reportAD_Org_ID"></div>
-						</select>
-					</td>
-					<td class="TitleCell"><span class="Label_ReadOnly_Text">Accounting schema</span></td>                    
-                    <td class="Combo_ContentCell"> 
-                       <select name="inpcAcctSchemaId" id="inpcAcctSchemaId" class="ComboKey Combo_TwoCells_width readonly">
-                        <option value=""> <div id="reportC_ACCTSCHEMA_ID"></div></option>       
-                       </select>
-                    </td>     
+				  <td class="TitleCell"><span class="LabelText">Organization</span></td>
+				  <td class="Combo_ContentCell" colspan="2">
+				    <select class="Combo Combo_TwoCells_width required" required="true" name="inpOrganization" id="inpOrganization">
+					  <option value=""></option>
+					  <div id="reportAD_Org_ID"></div>
+					</select>
+				  </td>
+				  <td class="TitleCell"><span class="Label_ReadOnly_Text">Accounting schema</span></td>                    
+                  <td class="Combo_ContentCell"> 
+                  <input type="hidden" name="inpcAcctSchemaId" id="inpcAcctSchemaId" class="ComboKey Combo_TwoCells_width readonly" value="xx"></input>
+				  <TABLE border="0" cellspacing="0" cellpadding="0" summary="" class="TextButton_ContentCell">
+				    <TR>
+				      <TD class="TextBox_ReadOnly_ContentCell">
+				      <TABLE style="border:0px;border-collapse:collapse;">
+				        <TR>
+				          <TD style="padding-top: 0px;">
+				            <INPUT type="text" class="dojoValidateValid readonly TextBox_TwoCells_width" tabindex="" maxlength="60"
+				              name="inpcAcctSchema" id="inpcAcctSchema" value="xx" required="true"
+				              onkeydown="changeToEditingMode('onkeydown');" onkeypress="changeToEditingMode('onkeypress');"
+				              oncut="changeToEditingMode('oncut');" onpaste="changeToEditingMode('onpaste');"
+				              oncontextmenu="changeToEditingMode('oncontextmenu');" onchange="validateTextBox(this.id);" readonly="true">
+				            </INPUT>
+				          </TD>
+				        </TR>
+				      </TABLE>
+				      </TD>
+				      <TD class="_ContentCell"></TD>
+    			    </TR>
+    			  </TABLE>
+                  </td>     
 				</tr>
 				<tr>
 					<td class="TitleCell"><span class="LabelText">Value</span></td>
--- a/src/org/openbravo/erpCommon/info/AccountElementValue.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/info/AccountElementValue.java	Mon May 03 18:42:20 2010 +0200
@@ -32,7 +32,6 @@
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.data.FieldProvider;
-import org.openbravo.erpCommon.businessUtility.AccountingSchemaMiscData;
 import org.openbravo.erpCommon.utility.ComboTableData;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.SQLReturnObject;
@@ -202,12 +201,12 @@
     }
 
     xmlDocument.setParameter("orgs", vars.getStringParameter("inpAD_Org_ID"));
-    xmlDocument.setParameter("cAcctschemaId", strAcctSchema);
-    xmlDocument.setData("reportC_ACCTSCHEMA_ID", "liststructure", AccountingSchemaMiscData
-        .selectC_ACCTSCHEMA_ID(this, Utility.getContext(this, vars, "#AccessibleOrgTree",
-            "ReportGeneralLedger"), Utility.getContext(this, vars, "#User_Client",
-            "ReportGeneralLedger"), strAcctSchema));
-
+    xmlDocument.setParameter("inpcAcctSchemaId", strAcctSchema);
+    if ("".equals(strAcctSchema))
+      xmlDocument.setParameter("inpcAcctSchema", "");
+    else
+      xmlDocument.setParameter("inpcAcctSchema", AccountElementValueData.selectschemaname(this,
+          strAcctSchema));
     xmlDocument.setParameter("grid", "20");
     xmlDocument.setParameter("grid_Offset", "");
     xmlDocument.setParameter("grid_SortCols", "1");
@@ -293,8 +292,8 @@
         String strOrderBy = SelectorUtility.buildOrderByClause(strOrderCols, strOrderDirs);
         page = TableSQLData.calcAndGetBackendPage(vars, "ShipmentReceiptLine.currentPage");
         if (vars.getStringParameter("movePage", "").length() > 0) {
-        	// on movePage action force executing countRows again
-        	strNewFilter = "";
+          // on movePage action force executing countRows again
+          strNewFilter = "";
         }
         int oldOffset = offset;
         offset = (page * TableSQLData.maxRowsPerGridPage) + offset;
@@ -304,18 +303,18 @@
           // or
           // first
           // load
-        	String rownum = "0", oraLimit1 = null, oraLimit2 = null, pgLimit = null;
-        	if (this.myPool.getRDBMS().equalsIgnoreCase("ORACLE")) {
-	        	oraLimit1 = String.valueOf(offset + TableSQLData.maxRowsPerGridPage);
-	        	oraLimit2 = (offset + 1) + " AND " + oraLimit1;
-	        	rownum = "ROWNUM";
-        	} else {
-        		pgLimit = TableSQLData.maxRowsPerGridPage + " OFFSET " + offset;
-        	}
-          strNumRows = AccountElementValueData.countRows(this,rownum, strAcctSchema, strValue, strName,
-              strOrganization, strAccountElementValue, Utility.getContext(this, vars,
+          String rownum = "0", oraLimit1 = null, oraLimit2 = null, pgLimit = null;
+          if (this.myPool.getRDBMS().equalsIgnoreCase("ORACLE")) {
+            oraLimit1 = String.valueOf(offset + TableSQLData.maxRowsPerGridPage);
+            oraLimit2 = (offset + 1) + " AND " + oraLimit1;
+            rownum = "ROWNUM";
+          } else {
+            pgLimit = TableSQLData.maxRowsPerGridPage + " OFFSET " + offset;
+          }
+          strNumRows = AccountElementValueData.countRows(this, rownum, strAcctSchema, strValue,
+              strName, strOrganization, strAccountElementValue, Utility.getContext(this, vars,
                   "#User_Client", "AccountElementValue"), Utility.getContext(this, vars,
-                  "#User_Org", "AccountElementValue"),pgLimit, oraLimit1, oraLimit2);
+                  "#User_Org", "AccountElementValue"), pgLimit, oraLimit1, oraLimit2);
           vars.setSessionValue("AccountElementValueInfo.numrows", strNumRows);
         } else {
           strNumRows = vars.getSessionValue("AccountElementValueInfo.numrows");
@@ -376,7 +375,8 @@
     strRowsData.append("    <title>").append(title).append("</title>\n");
     strRowsData.append("    <description>").append(description).append("</description>\n");
     strRowsData.append("  </status>\n");
-    strRowsData.append("  <rows numRows=\"").append(strNumRows).append("\" backendPage=\"" + page + "\">\n");
+    strRowsData.append("  <rows numRows=\"").append(strNumRows).append(
+        "\" backendPage=\"" + page + "\">\n");
     if (data != null && data.length > 0) {
       for (int j = 0; j < data.length; j++) {
         strRowsData.append("    <tr>\n");
--- a/src/org/openbravo/erpCommon/info/AccountElementValue.xml	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/info/AccountElementValue.xml	Mon May 03 18:42:20 2010 +0200
@@ -24,7 +24,8 @@
 	<PARAMETER id="paramCSS" name="theme" attribute="href" replace="Default"/>
 
 	<PARAMETER id="fieldOrgs" name="orgs" replace="xx" attribute="value" />
-    <PARAMETER id="paramC_ACCTSCHEMA_ID" name="cAcctschemaId"/>
+    <PARAMETER id="inpcAcctSchemaId" name="inpcAcctSchemaId" replace="xx" attribute="value"/>
+    <PARAMETER id="inpcAcctSchema" name="inpcAcctSchema" replace="xx" attribute="value"/>
 
 	<PARAMETER id="grid" name="grid" attribute="numrows" />
 	<PARAMETER id="grid" name="grid_Offset" attribute="offset" />
@@ -42,9 +43,6 @@
 	<SUBREPORT id="reportAD_Org_ID" name="reportAD_Org_ID" report="org/openbravo/erpCommon/reference/List">
 		<ARGUMENT name="parameterListSelected" withId="AD_Org_ID"/>
 	</SUBREPORT>
-    <SUBREPORT id="reportC_ACCTSCHEMA_ID" name="reportC_ACCTSCHEMA_ID" report="org/openbravo/erpCommon/reference/List">
-      <ARGUMENT name="parameterListSelected" withId="paramC_ACCTSCHEMA_ID"/>
-    </SUBREPORT>
-  
+
 	<DISCARD id="discard"/>
 </REPORT>
--- a/src/org/openbravo/erpCommon/info/AccountElementValue_data.xsql	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/info/AccountElementValue_data.xsql	Mon May 03 18:42:20 2010 +0200
@@ -130,4 +130,12 @@
       ]]></Sql>
         <Parameter name="key"/>
    </SqlMethod>
+
+   <SqlMethod name="selectschemaname" type="preparedStatement" return="String" default="">
+      <SqlMethodComment></SqlMethodComment>
+      <Sql> <![CDATA[
+        select name from c_acctschema where c_acctschema_id=?
+      ]]></Sql>
+        <Parameter name="key"/>
+   </SqlMethod>
 </SqlClass>
--- a/src/org/openbravo/erpCommon/modules/ExtractModule.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/modules/ExtractModule.java	Mon May 03 18:42:20 2010 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2010 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -214,17 +214,20 @@
         return !(s.equals(".svn") || s.equals(".hg"));
       }
     });
+    String fileSeparator = File.separator;
     for (int i = 0; list != null && i < list.length; i++) {
       if (list[i].isDirectory()) {
         // add entry for directory
-        obx.putNextEntry(new ZipEntry(new ZipEntry(list[i].toString().replace(relativeDir, ""))
+        obx.putNextEntry(new ZipEntry(new ZipEntry(list[i].toString().replace(relativeDir, "")
+            .replace(fileSeparator, "/"))
             + "/"));
         obx.closeEntry();
         createOBX(list[i], obx);
       } else {
         // add entry for file (and compress it)
         final byte[] buf = new byte[1024];
-        obx.putNextEntry(new ZipEntry(list[i].toString().replace(relativeDir, "")));
+        obx.putNextEntry(new ZipEntry(list[i].toString().replace(relativeDir, "").replace(
+            fileSeparator, "/")));
         final FileInputStream in = new FileInputStream(list[i].toString());
         int len;
         while ((len = in.read(buf)) > 0) {
--- a/src/org/openbravo/erpCommon/reference/PInstanceProcess_data.xsql	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/reference/PInstanceProcess_data.xsql	Mon May 03 18:42:20 2010 +0200
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2006 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2010 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -118,4 +118,20 @@
     <Parameter name="adUserId"/>
     <Parameter name="adUserId"/>
   </SqlMethod>
+  
+  <SqlMethod name="insertPInstanceParamTime" type="preparedStatement" return="rowCount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      INSERT INTO AD_PINSTANCE_PARA (ad_pinstance_para_id, AD_PINSTANCE_ID, SEQNO, PARAMETERNAME, P_DATE, AD_CLIENT_ID, AD_ORG_ID, CREATED, CREATEDBY, UPDATED, UPDATEDBY)
+      VALUES(get_uuid(),?,TO_NUMBER(?),?,to_timestamp(?, 'HH24:MI:SS'), ?, ?, now(), ?, now(), ?)
+    </Sql>
+    <Parameter name="adPinstanceId"/>
+    <Parameter name="seqno"/>
+    <Parameter name="parametername"/>
+    <Parameter name="pDate"/>
+    <Parameter name="adClientId"/>
+    <Parameter name="adOrgId"/>
+    <Parameter name="adUserId"/>
+    <Parameter name="adUserId"/>
+  </SqlMethod>
 </SqlClass>
--- a/src/org/openbravo/erpCommon/utility/UsedByLink.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/utility/UsedByLink.java	Mon May 03 18:42:20 2010 +0200
@@ -105,6 +105,8 @@
     xmlDocument.setParameter("recordIdentifier", UsedByLinkData.selectIdentifier(this, keyId, vars
         .getLanguage(), tableId));
 
+    String keyColumnId = UsedByLinkData.selectKeyColumnId(this, tableId);
+
     boolean nonAccessible = false;
 
     UsedByLinkData[] data = null;
@@ -124,11 +126,21 @@
     }
 
     data = UsedByLinkData.select(this, vars.getClient(), vars.getLanguage(), vars.getRole(),
-        keyColumn, tableId, linkedTablesQuery.toString());
+        keyColumnId, keyColumn, tableId, linkedTablesQuery.toString());
 
     if (data != null && data.length > 0) {
       final Vector<Object> vecTotal = new Vector<Object>();
       for (int i = 0; i < data.length; i++) {
+        String keyValue = keyId;
+        if (!data[i].referencedColumnId.equals(keyColumnId)) {
+          try {
+            keyValue = UsedByLinkData.selectKeyValue(this, UsedByLinkData.selectColumnName(this,
+                data[i].referencedColumnId), UsedByLinkData.selectTableName(this, tableId),
+                keyColumn, keyId);
+          } catch (Exception e) {
+            // TODO: handle exception
+          }
+        }
         if (log4j.isDebugEnabled())
           log4j.debug("***Referenced tab: " + data[i].adTabId);
         final UsedByLinkData[] dataRef = UsedByLinkData.windowRef(this, data[i].adTabId);
@@ -145,14 +157,14 @@
         if (!nonAccessible) {
           final String strNonAccessibleWhere = strWhereClause + " AND AD_ORG_ID NOT IN ("
               + vars.getUserOrg() + ")";
-          if (!UsedByLinkData.countLinks(this, data[i].tablename, data[i].columnname, keyId,
+          if (!UsedByLinkData.countLinks(this, data[i].tablename, data[i].columnname, keyValue,
               strNonAccessibleWhere).equals("0"))
             nonAccessible = true;
         }
         strWhereClause += " AND AD_ORG_ID IN (" + vars.getUserOrg() + ") AND AD_CLIENT_ID IN ("
             + vars.getUserClient() + ")";
         int total = Integer.valueOf(
-            UsedByLinkData.countLinks(this, data[i].tablename, data[i].columnname, keyId,
+            UsedByLinkData.countLinks(this, data[i].tablename, data[i].columnname, keyValue,
                 strWhereClause)).intValue();
 
         if (log4j.isDebugEnabled())
@@ -382,6 +394,7 @@
               && property.getTargetEntity() != null
               && property.getTargetEntity().getTableName().equalsIgnoreCase(tableName)) {
             final LinkedTable linkedTable = new LinkedTable();
+            System.out.println("p:" + property.getColumnName());
             linkedTable.setColumnId(property.getColumnId());
             linkedTables.add(linkedTable);
           }
--- a/src/org/openbravo/erpCommon/utility/UsedByLink_data.xsql	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpCommon/utility/UsedByLink_data.xsql	Mon May 03 18:42:20 2010 +0200
@@ -31,6 +31,7 @@
         SELECT AD_PARENT_MENU_ELEMENT(M.AD_MENU_ID, ?, ?) AS ELEMENT_NAME, 
         ((case when Wt.NAME IS NULL then W.NAME else  Wt.NAME end) || ' - ' || 
         (case when TBt.NAME IS NULL then TB.NAME else TBt.NAME end)) AS NAME, 
+        a.referenced_column_id,
         T.TABLENAME, C.COLUMNNAME, TB.AD_TAB_ID, '' AS HASTREE, '' AS ID, '' AS WHERECLAUSE, 0 AS TOTAL, 
         (case when Wt.NAME IS NULL then W.NAME else  Wt.NAME end) AS WINDOWNAME, 
         (case when TBt.NAME IS NULL then TB.NAME else TBt.NAME end) AS TABNAME,
@@ -41,33 +42,36 @@
                                                ELSE 'Y' 
                                                END) AS ACCESSIBLE
         FROM  (
-          SELECT AD_COLUMN_ID FROM AD_COLUMN 
+          SELECT AD_COLUMN_ID, ? as referenced_column_id 
+            FROM AD_COLUMN
            WHERE UPPER(COLUMNNAME) = UPPER(?) 
              AND (ISPARENT='Y' OR AD_REFERENCE_ID IN ('19', '35'))
         UNION 
-          SELECT AD_COLUMN.AD_COLUMN_ID FROM AD_COLUMN, AD_ELEMENT 
+          SELECT AD_COLUMN.AD_COLUMN_ID, ? as referenced_column_id  
+            FROM AD_COLUMN, AD_ELEMENT 
            WHERE AD_COLUMN.AD_ELEMENT_ID = AD_ELEMENT.AD_ELEMENT_ID 
              AND UPPER(REPLACE(REPLACE(REPLACE(AD_ELEMENT.columnname, 'Substitute_ID', 'M_Product_ID'),'BOM_ID', '_ID'), 'M_LocatorTo_ID', 'M_Locator_ID')) = UPPER(?) 
              AND AD_REFERENCE_ID IN ('30', '31')
              AND AD_REFERENCE_VALUE_ID IS NULL
         UNION
-          SELECT C.AD_COLUMN_ID
+          SELECT C.AD_COLUMN_ID, s.ad_column_id as referenced_column_id
             FROM AD_COLUMN C, AD_REF_SEARCH S
            WHERE C.AD_REFERENCE_ID = '30'
              AND S.AD_TABLE_ID = ?
              AND C.AD_REFERENCE_VALUE_ID = S.AD_REFERENCE_ID
         UNION 
-           SELECT C.AD_COLUMN_ID FROM AD_COLUMN C, AD_REF_TABLE R 
+           SELECT C.AD_COLUMN_ID, r.ad_key as referenced_column_id 
+             FROM AD_COLUMN C, AD_REF_TABLE R 
             WHERE C.AD_REFERENCE_ID = '18' 
               AND C.AD_REFERENCE_VALUE_ID = R.AD_REFERENCE_ID
-              AND EXISTS(SELECT 1 FROM AD_COLUMN WHERE UPPER(COLUMNNAME) = UPPER(?) 
-              AND AD_COLUMN_ID = R.AD_KEY) 
+              AND R.AD_TABLE_ID = ?
         UNION 
-          SELECT AD_COLUMN_ID FROM AD_COLUMN 
+          SELECT AD_COLUMN_ID, ? as referenced_column_id 
+            FROM AD_COLUMN 
            WHERE AD_REFERENCE_ID = '21' 
              AND UPPER(?) = 'C_LOCATION_ID'
         UNION
-            SELECT AD_COLUMN_ID
+            SELECT AD_COLUMN_ID, AD_COLUMN_ID as referenced_column_id 
               FROM AD_COLUMN
              WHERE AD_COLUMN_ID IN ('1')
         ) A, AD_TABLE T, AD_COLUMN C, AD_MENU M, 
@@ -87,7 +91,7 @@
         AND W.ISACTIVE = 'Y' 
         AND (TB.WHERECLAUSE IS NULL OR TB.WHERECLAUSE NOT LIKE '%@%') 
         GROUP BY M.AD_MENU_ID, (case when Wt.NAME IS NULL then W.NAME else  Wt.NAME end), 
-        (case when TBt.NAME IS NULL then TB.NAME else TBt.NAME end), T.TABLENAME, C.COLUMNNAME, TB.AD_TAB_ID, W.AD_WINDOW_ID
+        (case when TBt.NAME IS NULL then TB.NAME else TBt.NAME end), a.referenced_column_id, T.TABLENAME, C.COLUMNNAME, TB.AD_TAB_ID, W.AD_WINDOW_ID
         ORDER BY 1, (case when Wt.NAME IS NULL then W.NAME else  Wt.NAME end), 
         (case when TBt.NAME IS NULL then TB.NAME else TBt.NAME end), T.TABLENAME, C.COLUMNNAME, TB.AD_TAB_ID
       ]]>
@@ -95,10 +99,13 @@
     <Parameter name="adClientId"/>
     <Parameter name="adLanguage"/>
     <Parameter name="role"/>
+    <Parameter name="columnnId"/>
+    <Parameter name="columnnId"/>
+    <Parameter name="columnnId"/>
     <Parameter name="columnname"/>
     <Parameter name="columnname"/>
     <Parameter name="adTableId"/>
-    <Parameter name="columnname"/>
+    <Parameter name="adTableId"/>
     <Parameter name="columnname"/>
     <Parameter name="adLanguage"/>
     <Parameter name="adLanguage"/>
@@ -290,4 +297,56 @@
     <Parameter name="adTableId"/>
     <Parameter name="tableName"/>
   </SqlMethod>
+  
+  <SqlMethod name="selectTableName" type="preparedStatement" return="string">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT TABLENAME as ID
+        FROM AD_TABLE
+        WHERE AD_TABLE_ID = ?
+      ]]>
+    </Sql>
+    <Parameter name="key"/>
+  </SqlMethod>
+  
+  <SqlMethod name="selectKeyValue" type="preparedStatement" return="string">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT TABLENAME as ID
+        FROM AD_TABLE
+        WHERE AD_TABLE_ID = ?
+      ]]>
+    </Sql>
+    <Parameter name="columnnname" optional="true" type="replace" after="SELECT " text="TABLENAME"/>
+    <Parameter name="tablename" optional="true" type="replace" after="FROM " text="AD_TABLE"/>
+    <Parameter name="keyColumn" optional="true" type="replace" after="WHERE " text="AD_TABLE_ID"/>
+    <Parameter name="key"/>
+  </SqlMethod>
+  
+   <SqlMethod name="selectKeyColumnId" type="preparedStatement" return="string">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT AD_COLUMN_ID as ID
+        FROM AD_COLUMN
+        WHERE AD_TABLE_ID = ?
+          AND ISKEY='Y'
+      ]]>
+    </Sql>
+    <Parameter name="key"/>
+  </SqlMethod>
+  
+   <SqlMethod name="selectColumnName" type="preparedStatement" return="string">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT COLUMNNAME as ID
+        FROM AD_COLUMN
+        WHERE AD_column_ID = ?
+      ]]>
+    </Sql>
+    <Parameter name="key"/>
+  </SqlMethod>
 </SqlClass>
--- a/src/org/openbravo/erpReports/RptC_Remittance.java	Mon May 03 17:27:10 2010 +0200
+++ b/src/org/openbravo/erpReports/RptC_Remittance.java	Mon May 03 18:42:20 2010 +0200
@@ -27,10 +27,7 @@
 import javax.servlet.http.HttpServletResponse;
 
 import net.sf.jasperreports.engine.JRException;
-import net.sf.jasperreports.engine.JasperCompileManager;
 import net.sf.jasperreports.engine.JasperReport;
-import net.sf.jasperreports.engine.design.JasperDesign;
-import net.sf.jasperreports.engine.xml.JRXmlLoader;
 
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
@@ -77,9 +74,9 @@
 
     JasperReport jasperReportLines;
     try {
-      JasperDesign jasperDesignLines = JRXmlLoader.load(strBaseDesign
-          + "/org/openbravo/erpReports/RptC_Remittance_Lines.jrxml");
-      jasperReportLines = JasperCompileManager.compileReport(jasperDesignLines);
+      jasperReportLines = Utility.getTranslatedJasperReport(this, strBaseDesign
+          + "/org/openbravo/erpReports/RptC_Remittance_Lines.jrxml", vars.getLanguage(),
+          strBaseDesign);
     } catch (JRException e) {
       e.printStackTrace();
       throw new ServletException(e.getMessage());