[RTL] Merge from pi
authorDavid Baz Fayos <david.baz@openbravo.com>
Fri, 27 Apr 2012 14:25:34 +0200
changeset 16350 94ddd3197df9
parent 16349 ccc808d2c44f (current diff)
parent 16242 0a1174509a27 (diff)
child 16351 913d38e0198d
[RTL] Merge from pi
--- a/referencedata/sampledata/F_B_International_Group.xml	Fri Apr 27 14:24:26 2012 +0200
+++ b/referencedata/sampledata/F_B_International_Group.xml	Fri Apr 27 14:25:34 2012 +0200
@@ -146369,15 +146369,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="37BAB3F1DB2E4675BF819D9CBF6D74F7">
-    <id>37BAB3F1DB2E4675BF819D9CBF6D74F7</id>
-    <process id="153"/>
-    <role id="6DCC4F942CE944F997596B9EA51A4FEB"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="37D36B205E7640C7937BE49AD2613D4A">
     <id>37D36B205E7640C7937BE49AD2613D4A</id>
     <process id="1004400000"/>
@@ -151400,15 +151391,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="6A4E7ADA6F4A40E3BF65486336E7061E">
-    <id>6A4E7ADA6F4A40E3BF65486336E7061E</id>
-    <process id="153"/>
-    <role id="E669860946664B24BD1AE1ACDF2F5FC3"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="6A514588BE1D49D9BFEE9809B9F5B3C9">
     <id>6A514588BE1D49D9BFEE9809B9F5B3C9</id>
     <process id="800103"/>
@@ -152408,15 +152390,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="75165797F27548BEBB78DB29B89299C4">
-    <id>75165797F27548BEBB78DB29B89299C4</id>
-    <process id="153"/>
-    <role id="1CAE17A7848D4F0BAAF21FEB17045B88"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="75226706923A447094461A8DC89BA271">
     <id>75226706923A447094461A8DC89BA271</id>
     <process id="800006"/>
@@ -153371,15 +153344,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="7D7F7C5ECD4543C8858307500D5A09F0">
-    <id>7D7F7C5ECD4543C8858307500D5A09F0</id>
-    <process id="153"/>
-    <role id="9A2D4EC760704A79BAFF8FF244FE0273"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="7D9CE452D8FD4259982354746F3BAC9B">
     <id>7D9CE452D8FD4259982354746F3BAC9B</id>
     <process id="176"/>
@@ -153587,15 +153551,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="7FCBE16AF5D34010BD0F81D58B737955">
-    <id>7FCBE16AF5D34010BD0F81D58B737955</id>
-    <process id="153"/>
-    <role id="F77D70601AD549B19DE47965F6D48D12"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="7FD051B9DEA749B297BF9521FE9CFC43">
     <id>7FD051B9DEA749B297BF9521FE9CFC43</id>
     <process id="1004400002"/>
@@ -154829,15 +154784,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="8C0BD5DCD9014FCBB36AE2A5358763B7">
-    <id>8C0BD5DCD9014FCBB36AE2A5358763B7</id>
-    <process id="153"/>
-    <role id="DB6660F6713A4DCFA320A502B4A0E670"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="8C30F8A5362242608C52A1AF1F62A436">
     <id>8C30F8A5362242608C52A1AF1F62A436</id>
     <process id="107"/>
@@ -158375,15 +158321,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="AC402BB3777B445195EAB7BB18CC904D">
-    <id>AC402BB3777B445195EAB7BB18CC904D</id>
-    <process id="153"/>
-    <role id="F3196A30B53A42778727B2852FF90C24"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="AC6A1ED2B33E4BD9BD437C12A8C18F51">
     <id>AC6A1ED2B33E4BD9BD437C12A8C18F51</id>
     <process id="800075"/>
@@ -159005,15 +158942,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="B276C938CE2743CD82192BCC11BB9E42">
-    <id>B276C938CE2743CD82192BCC11BB9E42</id>
-    <process id="153"/>
-    <role id="42D0EEB1C66F497A90DD526DC597E6F0"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="B278B8DEF42D4352A3575FCF9AA5157D">
     <id>B278B8DEF42D4352A3575FCF9AA5157D</id>
     <process id="FF80808133362F6A013336781FCE0066"/>
@@ -159581,15 +159509,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="B842D825B7D14975958B668CEC5AC203">
-    <id>B842D825B7D14975958B668CEC5AC203</id>
-    <process id="153"/>
-    <role id="0D4689364DDB473BB3023E4E554C8762"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="B864AC74A30645D5B71476621CCCFFB5">
     <id>B864AC74A30645D5B71476621CCCFFB5</id>
     <process id="800133"/>
@@ -164270,15 +164189,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="E8B6820FF5944A86B22C1C9FBBBD544C">
-    <id>E8B6820FF5944A86B22C1C9FBBBD544C</id>
-    <process id="153"/>
-    <role id="8CB7726D1DCD435FAF7D1654C9560F81"/>
-    <client id="23C59575B9CF467C9620760EB255B389"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="E8D3BAFBFC594027B2F01B81F02DD78E">
     <id>E8D3BAFBFC594027B2F01B81F02DD78E</id>
     <process id="139"/>
--- a/referencedata/sampledata/QA_Testing.xml	Fri Apr 27 14:24:26 2012 +0200
+++ b/referencedata/sampledata/QA_Testing.xml	Fri Apr 27 14:25:34 2012 +0200
@@ -71747,15 +71747,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="92E3AF2BC8644A5DBB2D2E29C9519400">
-    <id>92E3AF2BC8644A5DBB2D2E29C9519400</id>
-    <process id="153"/>
-    <role id="CC6AB5B4C4B54CB79103C96AD2B90750"/>
-    <client id="4028E6C72959682B01295A070852010D"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="93600CF46F4042DCA2816D63412191CB">
     <id>93600CF46F4042DCA2816D63412191CB</id>
     <process id="BBA11D1A061346459AF6148920FE6629"/>
@@ -72602,15 +72593,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="AB68FEDCFA824C7DA7E993C1B746BA6A">
-    <id>AB68FEDCFA824C7DA7E993C1B746BA6A</id>
-    <process id="153"/>
-    <role id="0256D4272D82412C9CDF41B67E362599"/>
-    <client id="4028E6C72959682B01295A070852010D"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="ABA94DE3AEC947248C432CD9050C1BA6">
     <id>ABA94DE3AEC947248C432CD9050C1BA6</id>
     <process id="136"/>
@@ -73115,15 +73097,6 @@
     <active>true</active>
     <editableField>true</editableField>
   </ADProcessAccess>
-  <ADProcessAccess id="BB6C246AA19B446CBB7100BDBA83753D">
-    <id>BB6C246AA19B446CBB7100BDBA83753D</id>
-    <process id="153"/>
-    <role id="4028E6C72959682B01295A071429011E"/>
-    <client id="4028E6C72959682B01295A070852010D"/>
-    <organization id="0"/>
-    <active>true</active>
-    <editableField>true</editableField>
-  </ADProcessAccess>
   <ADProcessAccess id="BC0AFEE19CCA42B4A666B90423175EBC">
     <id>BC0AFEE19CCA42B4A666B90423175EBC</id>
     <process id="800076"/>
--- a/src-db/database/model/functions/C_INVOICE_POST.xml	Fri Apr 27 14:24:26 2012 +0200
+++ b/src-db/database/model/functions/C_INVOICE_POST.xml	Fri Apr 27 14:25:34 2012 +0200
@@ -59,6 +59,7 @@
   Cur_LastContact RECORD;
   Cur_lineqty RECORD;
   Cur_InvoiceTax RECORD;
+  Cur_TaxMAct RECORD;
 
   -- Record Info
   v_Client_ID VARCHAR2(32);
@@ -1223,6 +1224,7 @@
       v_ActualBaseAmt NUMBER;
       v_FirstLine BOOLEAN;
       v_C_InvoiceTax_ID VARCHAR2(32);
+      
     BEGIN
       v_ResultStr:='DeleteOldTaxes';
       DELETE FROM C_INVOICELINETAX
@@ -1230,6 +1232,16 @@
       DELETE FROM C_INVOICETAX
       WHERE C_Invoice_ID=v_Record_ID
         AND Recalculate = 'Y';
+      -- Update line if recalculate='N'
+      FOR Cur_TaxMAct IN
+        ( SELECT C_INVOICETAX_ID FROM C_INVOICETAX
+          WHERE C_Invoice_ID=v_Record_ID
+          AND Recalculate = 'N'
+        )
+      LOOP
+        v_LineNo:=v_LineNo+10;
+        UPDATE C_INVOICETAX SET line=v_LineNo WHERE C_INVOICETAX_ID=Cur_TaxMAct.C_INVOICETAX_ID;   
+      END LOOP;
       -- For all Tax Rates
       v_ResultStr:='InsertNewTaxes';
       FOR Cur_Tax IN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/M_LOCATOR_TRG.xml	Fri Apr 27 14:25:34 2012 +0200
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER M_LOCATOR_TRG">
+    <trigger name="M_LOCATOR_TRG" table="M_LOCATOR" 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.1  (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) 2012 Openbravo SLU
+    * All Rights Reserved.
+    * Contributor(s):  ______________________________________.
+    ************************************************************************/
+
+  v_count NUMBER;
+
+     
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+
+  IF UPDATING THEN
+    if (:old.isactive = 'Y') then 
+	if (:new.isactive = 'N') then
+		select count(*)
+			into v_count
+			from m_storage_detail
+			where m_locator_id = :old.m_locator_id 
+			and COALESCE(qtyonhand,0) <> '0' 
+			or COALESCE(qtyorderonhand, 0) <> '0' 
+			or COALESCE(preqtyonhand, 0) <> '0' 
+			or COALESCE(preqtyorderonhand, 0) <> '0';
+
+		if (v_count <> '0') then
+			RAISE_APPLICATION_ERROR(-20000, '@StockAvailable@');
+		end if;
+	end if;
+    end if;
+  END IF;
+   
+END M_LOCATOR_TRG
+]]></body>
+    </trigger>
+  </database>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Apr 27 14:24:26 2012 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Apr 27 14:25:34 2012 +0200
@@ -17400,6 +17400,17 @@
 <!--7BF4B33E022E407BB6615E106AC7A8A6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--7BF4B33E022E407BB6615E106AC7A8A6--></AD_MESSAGE>
 
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA--><AD_MESSAGE>
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA-->  <AD_MESSAGE_ID><![CDATA[7CFF0A95CF3B47DEA3FE044826E0E3EA]]></AD_MESSAGE_ID>
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA-->  <VALUE><![CDATA[NoProductInDefaultPriceList]]></VALUE>
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA-->  <MSGTEXT><![CDATA[This product is not defined in the default price list.]]></MSGTEXT>
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7CFF0A95CF3B47DEA3FE044826E0E3EA--></AD_MESSAGE>
+
 <!--7D189EE376C54A0A877A6FB41C6E2E68--><AD_MESSAGE>
 <!--7D189EE376C54A0A877A6FB41C6E2E68-->  <AD_MESSAGE_ID><![CDATA[7D189EE376C54A0A877A6FB41C6E2E68]]></AD_MESSAGE_ID>
 <!--7D189EE376C54A0A877A6FB41C6E2E68-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -19579,6 +19590,17 @@
 <!--D797EF78993647C2AD25D0969824E768-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--D797EF78993647C2AD25D0969824E768--></AD_MESSAGE>
 
+<!--D7C0ED1073B048A496DF3B253D4F97EE--><AD_MESSAGE>
+<!--D7C0ED1073B048A496DF3B253D4F97EE-->  <AD_MESSAGE_ID><![CDATA[D7C0ED1073B048A496DF3B253D4F97EE]]></AD_MESSAGE_ID>
+<!--D7C0ED1073B048A496DF3B253D4F97EE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D7C0ED1073B048A496DF3B253D4F97EE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D7C0ED1073B048A496DF3B253D4F97EE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D7C0ED1073B048A496DF3B253D4F97EE-->  <VALUE><![CDATA[NoDefaultPriceList]]></VALUE>
+<!--D7C0ED1073B048A496DF3B253D4F97EE-->  <MSGTEXT><![CDATA[There is not default price list defined.]]></MSGTEXT>
+<!--D7C0ED1073B048A496DF3B253D4F97EE-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--D7C0ED1073B048A496DF3B253D4F97EE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D7C0ED1073B048A496DF3B253D4F97EE--></AD_MESSAGE>
+
 <!--D8089BD51CC84B59915D9B110C96F7B4--><AD_MESSAGE>
 <!--D8089BD51CC84B59915D9B110C96F7B4-->  <AD_MESSAGE_ID><![CDATA[D8089BD51CC84B59915D9B110C96F7B4]]></AD_MESSAGE_ID>
 <!--D8089BD51CC84B59915D9B110C96F7B4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -19891,6 +19913,17 @@
 <!--E7695A84B58B41B5915DF1B73D3E0A66-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--E7695A84B58B41B5915DF1B73D3E0A66--></AD_MESSAGE>
 
+<!--E7B3836CF7F744E3BC29DDB5794A9162--><AD_MESSAGE>
+<!--E7B3836CF7F744E3BC29DDB5794A9162-->  <AD_MESSAGE_ID><![CDATA[E7B3836CF7F744E3BC29DDB5794A9162]]></AD_MESSAGE_ID>
+<!--E7B3836CF7F744E3BC29DDB5794A9162-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E7B3836CF7F744E3BC29DDB5794A9162-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E7B3836CF7F744E3BC29DDB5794A9162-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E7B3836CF7F744E3BC29DDB5794A9162-->  <VALUE><![CDATA[StockAvailable]]></VALUE>
+<!--E7B3836CF7F744E3BC29DDB5794A9162-->  <MSGTEXT><![CDATA[The storage bin has products with stock. Please set their stock to zero before deactivating the storage bin. You can do that moving the contents to another bin using "Goods Movements" window.]]></MSGTEXT>
+<!--E7B3836CF7F744E3BC29DDB5794A9162-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--E7B3836CF7F744E3BC29DDB5794A9162-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E7B3836CF7F744E3BC29DDB5794A9162--></AD_MESSAGE>
+
 <!--E83760BF3C4E4BE9BEEE76CD6CBE734F--><AD_MESSAGE>
 <!--E83760BF3C4E4BE9BEEE76CD6CBE734F-->  <AD_MESSAGE_ID><![CDATA[E83760BF3C4E4BE9BEEE76CD6CBE734F]]></AD_MESSAGE_ID>
 <!--E83760BF3C4E4BE9BEEE76CD6CBE734F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Fri Apr 27 14:24:26 2012 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Fri Apr 27 14:25:34 2012 +0200
@@ -846,27 +846,6 @@
 <!--151-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--151--></AD_PROCESS>
 
-<!--153--><AD_PROCESS>
-<!--153-->  <AD_PROCESS_ID><![CDATA[153]]></AD_PROCESS_ID>
-<!--153-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--153-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--153-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--153-->  <VALUE><![CDATA[C_Payment_Post Online]]></VALUE>
-<!--153-->  <NAME><![CDATA[Online Process]]></NAME>
-<!--153-->  <DESCRIPTION><![CDATA[Online Process]]></DESCRIPTION>
-<!--153-->  <HELP><![CDATA[Online Process]]></HELP>
-<!--153-->  <ACCESSLEVEL><![CDATA[1]]></ACCESSLEVEL>
-<!--153-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
-<!--153-->  <ISREPORT><![CDATA[N]]></ISREPORT>
-<!--153-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
-<!--153-->  <CLASSNAME><![CDATA[org.openbravo.process.PaymentProcess]]></CLASSNAME>
-<!--153-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
-<!--153-->  <ISJASPER><![CDATA[N]]></ISJASPER>
-<!--153-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--153-->  <UIPATTERN><![CDATA[M]]></UIPATTERN>
-<!--153-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
-<!--153--></AD_PROCESS>
-
 <!--154--><AD_PROCESS>
 <!--154-->  <AD_PROCESS_ID><![CDATA[154]]></AD_PROCESS_ID>
 <!--154-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-test/org/openbravo/test/xml/EntityXMLIssues.java	Fri Apr 27 14:24:26 2012 +0200
+++ b/src-test/org/openbravo/test/xml/EntityXMLIssues.java	Fri Apr 27 14:25:34 2012 +0200
@@ -19,14 +19,18 @@
 
 package org.openbravo.test.xml;
 
+import java.io.StringWriter;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.dal.core.DalUtil;
+import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.xml.EntityXMLConverter;
 import org.openbravo.model.ad.datamodel.Column;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.common.businesspartner.Greeting;
@@ -163,4 +167,35 @@
     assertTrue(column2.getLength() == 60);
     OBDal.getInstance().rollbackAndClose();
   }
+
+  /**
+   * 20357: There should be a way to define with properties i want to export in a EntityXMLConverter
+   * call
+   */
+  public void testIssue20357() {
+
+    final OBCriteria<BaseOBObject> obc = OBDal.getInstance().createCriteria("Product");
+    final EntityXMLConverter exc = EntityXMLConverter.newInstance();
+
+    exc.setOptionIncludeChildren(false);
+    exc.setOptionEmbedChildren(false);
+    exc.setOptionIncludeReferenced(false);
+    exc.setOptionExportClientOrganizationReferences(false);
+
+    StringWriter sw = new StringWriter();
+    exc.setOutput(sw);
+
+    exc.process(obc.list());
+
+    // We only need the id, name of the products
+    exc.setIncludedProperties(Arrays.asList("id", "name"));
+
+    StringWriter sw2 = new StringWriter();
+    exc.setOutput(sw2);
+
+    exc.process(obc.list());
+
+    // dummy assert
+    assertNotSame("Exported XML is the same", exc.toString(), sw2.toString());
+  }
 }
\ No newline at end of file
--- a/src-wad/src/org/openbravo/wad/validation/WADValidationResult.java	Fri Apr 27 14:24:26 2012 +0200
+++ b/src-wad/src/org/openbravo/wad/validation/WADValidationResult.java	Fri Apr 27 14:25:34 2012 +0200
@@ -50,7 +50,8 @@
         "Model Object"), MODEL_OBJECT_MAPPING("HTML Mapping"), COLUMN_NAME("Column Naming"), AUXILIARINPUT(
         "Auxiliary Input Name"), MULTIPLE_KEYS("Multiple Key Columns in Table"), BASEREFERENCE_WITH_PARENT(
         "Base Reference with Parent Reference"), PROCESS_WITHOUT_CLASS(
-        "Standard UI Processes without class");
+        "Standard UI Processes without class"), TABS_WITH_MULTIPLE_FIELDS_FOR_SAME_COLUMN(
+        "Tabs with multiple fields for same column");
 
     private String description;
 
--- a/src-wad/src/org/openbravo/wad/validation/WADValidator.java	Fri Apr 27 14:24:26 2012 +0200
+++ b/src-wad/src/org/openbravo/wad/validation/WADValidator.java	Fri Apr 27 14:25:34 2012 +0200
@@ -64,7 +64,7 @@
     validateAuxiliarInput(result);
     validateReferences(result);
     validateProcessWithoutClass(result);
-    validateFieldsOfTabs(result);
+    validateTabsWithMultipleFieldsForSameColumn(result);
     return result;
   }
 
@@ -218,16 +218,16 @@
    * 
    * @param result
    */
-  private void validateFieldsOfTabs(WADValidationResult result) {
+  private void validateTabsWithMultipleFieldsForSameColumn(WADValidationResult result) {
     try {
-      WADValidatorData data[] = WADValidatorData.checkColumnIdsOfFields(conn);
+      WADValidatorData data[] = WADValidatorData.checkTabsWithMultipleFieldsForSameColumn(conn,
+          modules, checkAll);
       for (WADValidatorData issue : data) {
-        result.addError(
-            issue.moduleid,
-            issue.modulename,
-            WADValidationType.MODEL_OBJECT,
-            "The tab " + issue.objectname.split(" - ")[0] + " of the window "
-                + issue.objectname.split(" - ")[1] + " has to fields pointing to the same column.");
+        result.addError(issue.moduleid, issue.modulename,
+            WADValidationType.TABS_WITH_MULTIPLE_FIELDS_FOR_SAME_COLUMN, "Error in field "
+                + issue.fieldname + ". There are more than one fields pointing to the column "
+                + issue.columnname + " in the tab " + issue.tabname + " of the " + issue.windowname
+                + " window.");
       }
     } catch (Exception e) {
       result.addWarning(WADValidationType.SQL,
--- a/src-wad/src/org/openbravo/wad/validation/WADValidator_data.xsql	Fri Apr 27 14:24:26 2012 +0200
+++ b/src-wad/src/org/openbravo/wad/validation/WADValidator_data.xsql	Fri Apr 27 14:25:34 2012 +0200
@@ -36,6 +36,12 @@
     <Field name="objecttype" value=""/>
     <Field name="currentvalue" value=""/>
     <Field name="expectedvalue" value=""/>
+    <Field name="fieldname" value=""/>
+    <Field name="tabid" value=""/>
+    <Field name="tabname" value=""/>
+    <Field name="windowname" value=""/>
+    <Field name="columnname" value=""/>
+    <Field name="columnid" value=""/>
     <Parameter name="module" optional="true" type="replace" after="m.javapackage in (" text="'1'"/>
     <Parameter name="checkAll"/>
   </SqlMethod>
@@ -321,17 +327,25 @@
     <Parameter name="module" optional="true" type="replace" after="m.javapackage in (" text="'1'"/>
     <Parameter name="checkAll"/>
   </SqlMethod>
-  <SqlMethod name="checkColumnIdsOfFields" type="preparedStatement" return="multiple">
+  <SqlMethod name="checkTabsWithMultipleFieldsForSameColumn" type="preparedStatement" return="multiple">
     <Sql>
       <![CDATA[
-        SELECT t.name || ' - ' || w.name  as objectName, m.name as moduleName, t.ad_module_id as moduleId FROM
-        (SELECT ad_tab_id, count(*) as linesCount
-        FROM ad_field
-        GROUP BY ad_tab_id,ad_column_id) a inner join ad_tab t on a.ad_tab_id = t.ad_tab_id
-                   inner join ad_window w on t.ad_window_id = w.ad_window_id
-                   inner join ad_module m on m.ad_module_id = t.ad_module_id
-        WHERE a.linesCount > 1
+      select ad_tab.ad_tab_id as tabid, ad_column.ad_column_id as columnid, ad_window.name as windowname, ad_tab.name as tabname,
+             ad_field.name fieldname,ad_column.name as columnname, ad_field.ad_module_id as moduleid, ad_module.name as modulename
+      from ad_window, ad_tab, ad_field, ad_column, ad_module
+      where ad_field.ad_column_id = ad_column.ad_column_id
+      and ad_field.ad_module_id = ad_module.ad_module_id
+      and ad_tab.ad_tab_id = ad_field.ad_tab_id
+      and ad_window.ad_window_id = ad_tab.ad_window_id
+      and (ad_module.javapackage in ('1') or to_char('Y')=to_char(?))
+      and exists (select * from ad_field subFld where
+            subFld.ad_tab_id = ad_field.ad_tab_id
+            and subFld.ad_column_id = ad_field.ad_column_id
+            and ad_field.ad_field_id <> subFld.ad_field_id)
+      order by ad_tab.ad_tab_id, ad_column.ad_column_id
       ]]>
     </Sql>
+    <Parameter name="module" optional="true" type="replace" after="ad_module.javapackage in (" text="'1'"/>
+    <Parameter name="checkAll"/>
   </SqlMethod>
 </SqlClass>
--- a/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java	Fri Apr 27 14:24:26 2012 +0200
+++ b/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java	Fri Apr 27 14:25:34 2012 +0200
@@ -19,6 +19,9 @@
 package org.openbravo.common.actionhandler;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -26,14 +29,27 @@
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
+import org.hibernate.criterion.Restrictions;
+import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
+import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.client.application.process.BaseProcessActionHandler;
+import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.order.Order;
 import org.openbravo.model.common.order.OrderLine;
 import org.openbravo.model.common.order.ReturnReason;
+import org.openbravo.model.financialmgmt.tax.TaxRate;
 import org.openbravo.model.materialmgmt.transaction.ShipmentInOutLine;
+import org.openbravo.model.pricing.pricelist.PriceList;
+import org.openbravo.model.pricing.pricelist.PriceListVersion;
+import org.openbravo.model.pricing.pricelist.ProductPrice;
+import org.openbravo.service.db.CallStoredProcedure;
+import org.openbravo.service.db.DalConnectionProvider;
 
 /**
  * 
@@ -57,6 +73,22 @@
       }
 
     } catch (Exception e) {
+      VariablesSecureApp vars = RequestContext.get().getVariablesSecureApp();
+
+      try {
+        jsonRequest = new JSONObject();
+
+        JSONObject errorMessage = new JSONObject();
+        errorMessage.put("severity", "error");
+        errorMessage.put("text",
+            Utility.messageBD(new DalConnectionProvider(), e.getMessage(), vars.getLanguage()));
+
+        jsonRequest.put("message", errorMessage);
+      } catch (Exception e2) {
+        log.error(e.getMessage(), e2);
+        // do nothing, give up
+      }
+
       log.error(e.getMessage(), e);
     } finally {
       OBContext.restorePreviousMode();
@@ -80,7 +112,7 @@
     return true;
   }
 
-  private void createOrderLines(JSONObject jsonRequest) throws JSONException {
+  private void createOrderLines(JSONObject jsonRequest) throws JSONException, OBException {
     JSONArray selectedLines = jsonRequest.getJSONArray("_selection");
     // if no lines selected don't do anything.
     if (selectedLines.length() == 0) {
@@ -109,13 +141,47 @@
       BigDecimal qtyReturned = new BigDecimal(selectedLine.getString("returned"));
       newOrderLine.setOrderedQuantity(qtyReturned.negate());
       // Price
-      BigDecimal price = new BigDecimal(selectedLine.getString("unitPrice"));
-      newOrderLine.setUnitPrice(price);
-      newOrderLine.setListPrice(shipmentLine.getSalesOrderLine().getListPrice());
-      newOrderLine.setPriceLimit(shipmentLine.getSalesOrderLine().getPriceLimit());
-      newOrderLine.setStandardPrice(shipmentLine.getSalesOrderLine().getStandardPrice());
+      HashMap<String, BigDecimal> prices = null;
 
-      newOrderLine.setTax(shipmentLine.getSalesOrderLine().getTax());
+      if (shipmentLine.getSalesOrderLine() == null) {
+        prices = getPrices(strOrderId, shipmentLine.getProduct().getId(), order.getOrderDate());
+      }
+
+      if (prices != null) {
+        newOrderLine.setUnitPrice(prices.get("unitPrice"));
+        newOrderLine.setListPrice(prices.get("listPrice"));
+        newOrderLine.setPriceLimit(prices.get("priceLimit"));
+        newOrderLine.setStandardPrice(prices.get("standardPrice"));
+
+        // tax
+        List<Object> parameters = new ArrayList<Object>();
+
+        parameters.add(shipmentLine.getProduct().getId());
+        parameters.add(order.getOrderDate());
+        parameters.add(order.getOrganization().getId());
+        parameters.add(order.getWarehouse().getId());
+        parameters.add(order.getPartnerAddress().getId());
+        parameters.add(order.getInvoiceAddress().getId());
+        if (order.getProject() != null) {
+          parameters.add(order.getProject().getId());
+        } else {
+          parameters.add(null);
+        }
+        parameters.add("Y");
+
+        String taxId = (String) CallStoredProcedure.getInstance()
+            .call("C_Gettax", parameters, null);
+        TaxRate tax = OBDal.getInstance().get(TaxRate.class, taxId);
+
+        newOrderLine.setTax(tax);
+      } else {
+        newOrderLine.setUnitPrice(new BigDecimal(selectedLine.getString("unitPrice")));
+        newOrderLine.setListPrice(shipmentLine.getSalesOrderLine().getListPrice());
+        newOrderLine.setPriceLimit(shipmentLine.getSalesOrderLine().getPriceLimit());
+        newOrderLine.setStandardPrice(shipmentLine.getSalesOrderLine().getStandardPrice());
+
+        newOrderLine.setTax(shipmentLine.getSalesOrderLine().getTax());
+      }
 
       if (selectedLine.getString("returnReason") != null
           && !selectedLine.getString("returnReason").equals("null")) {
@@ -134,4 +200,118 @@
       OBDal.getInstance().flush();
     }
   }
+
+  HashMap<String, BigDecimal> getPrices(String strOrderId, String strProductId, Date orderDate)
+      throws OBException {
+    HashMap<String, BigDecimal> prices = new HashMap<String, BigDecimal>();
+    try {
+      OBContext.setAdminMode(true);
+      Order o = OBDal.getInstance().get(Order.class, strOrderId);
+      PriceList pl = o.getBusinessPartner().getPurchasePricelist();
+      PriceListVersion earliestPlv = null;
+      boolean isDefultPriceList = false;
+      // There is no price list in the Busines Partner so default sales price list is taken.
+      if (pl == null) {
+        pl = getDefaultSalesPriceList(o.getClient().getId(), o.getOrganization().getId());
+        isDefultPriceList = true;
+      }
+
+      // Get a fit price list version.
+      if (pl != null) {
+        earliestPlv = getEarliestPriceListVersion(pl, orderDate);
+      } else {
+        // If pl was the default price list, there is no default price list.
+        if (isDefultPriceList) {
+          throw new OBException("NoDefaultPriceList");
+        } else {
+          // If pl was the Business Partner's price list, there was no fit price list for it so take
+          // the default price list.
+          pl = getDefaultSalesPriceList(o.getClient().getId(), o.getOrganization().getId());
+          earliestPlv = getEarliestPriceListVersion(pl, orderDate);
+          // There is no fit price list version.
+          if (earliestPlv == null) {
+            throw new OBException("NoDefaultPriceList");
+          }
+        }
+      }
+
+      if (earliestPlv != null) {
+        prices = getProductPricesFromPLV(strProductId, earliestPlv);
+        if (prices == null && isDefultPriceList) {
+          throw new OBException("NoProductInDefaultPriceList");
+        } else {
+          pl = getDefaultSalesPriceList(o.getClient().getId(), o.getOrganization().getId());
+          earliestPlv = getEarliestPriceListVersion(pl, orderDate);
+          if (earliestPlv == null) {
+            throw new OBException("NoDefaultPriceList");
+          } else {
+            prices = getProductPricesFromPLV(strProductId, earliestPlv);
+            if (prices == null) {
+              throw new OBException("NoProductInDefaultPriceList");
+            } else {
+              return prices;
+            }
+          }
+        }
+      }
+      return null;
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
+  PriceList getDefaultSalesPriceList(String clientId, String orgId) throws OBException {
+    List<PriceList> pll = null;
+    final OBCriteria<PriceList> obc = OBDal.getInstance().createCriteria(PriceList.class);
+
+    obc.add(Restrictions.eq("default", true));
+    obc.add(Restrictions.eq("salesPriceList", true));
+    ArrayList<Organization> orgs = new ArrayList<Organization>();
+    for (String orgauxId : OBContext.getOBContext().getOrganizationStructureProvider(clientId)
+        .getNaturalTree(orgId)) {
+      orgs.add(OBDal.getInstance().get(Organization.class, orgauxId));
+    }
+    obc.add(Restrictions.in("organization", orgs));
+    pll = obc.list();
+    if (pll.size() > 0) {
+      return obc.list().get(0);
+    }
+    return null;
+  }
+
+  PriceListVersion getEarliestPriceListVersion(PriceList pl, Date orderDate) {
+    PriceListVersion plv, earliestPlv = null;
+
+    for (int j = 0; j < pl.getPricingPriceListVersionList().size(); j++) {
+      plv = pl.getPricingPriceListVersionList().get(j);
+
+      if (plv != null && plv.getValidFromDate().before(orderDate)) {
+        if (earliestPlv == null) {
+          earliestPlv = plv;
+        }
+        if (plv.getValidFromDate().before(earliestPlv.getValidFromDate())) {
+          earliestPlv = plv;
+        }
+      }
+    }
+    return earliestPlv;
+  }
+
+  HashMap<String, BigDecimal> getProductPricesFromPLV(String strProductId,
+      PriceListVersion earliestPlv) {
+    List<ProductPrice> ppl = earliestPlv.getPricingProductPriceList();
+    HashMap<String, BigDecimal> prices = new HashMap<String, BigDecimal>();
+
+    for (int j = 0; j < ppl.size(); j++) {
+      if (ppl.get(j).getProduct().getId().equalsIgnoreCase(strProductId)) {
+        prices.put("unitPrice", ppl.get(j).getStandardPrice());
+        prices.put("standardPrice", ppl.get(j).getStandardPrice());
+        prices.put("listPrice", ppl.get(j).getListPrice());
+        prices.put("priceLimit", ppl.get(j).getPriceLimit());
+        return prices;
+      }
+    }
+
+    return null;
+  }
 }
--- a/src/org/openbravo/dal/xml/EntityXMLConverter.java	Fri Apr 27 14:24:26 2012 +0200
+++ b/src/org/openbravo/dal/xml/EntityXMLConverter.java	Fri Apr 27 14:25:34 2012 +0200
@@ -129,6 +129,9 @@
   private DataSet dataSet;
   private Map<Entity, DataSetTable> dataSetTablesByEntity;
 
+  // properties that are to be exported
+  private List<String> includedProperties = new ArrayList<String>();
+
   /**
    * Clear internal data structures, after this call this converter can be used for a new set of
    * objects which need to be exported to a xml representation.
@@ -336,6 +339,9 @@
       if (excludeAuditInfo != null && excludeAuditInfo) {
         DataSetService.getInstance().removeAuditInfo(exportableProperties);
       }
+      if (!includedProperties.isEmpty()) {
+        filterProperties(exportableProperties);
+      }
     }
 
     // export each property
@@ -384,6 +390,7 @@
       final Object value = obObject.get(p.getName());
 
       // will result in an empty tag if null
+
       if (value == null) {
         propertyAttrs.addAttribute("", "", "xsi:nil", "CDATA", "true");
         xmlHandler.startElement("", "", p.getName(), propertyAttrs);
@@ -466,7 +473,6 @@
             addToExportList((BaseOBObject) o);
           }
         }
-
         xmlHandler.endElement("", "", p.getName());
       } else if (!p.isOneToMany()) {
 
@@ -487,6 +493,20 @@
     xmlHandler.endElement("", "", entityName);
   }
 
+  /**
+   * Filters the list of properties to export using the includedProperties list
+   * 
+   */
+  private void filterProperties(List<Property> properties) {
+    final List<Property> toRemove = new ArrayList<Property>();
+    for (final Property p : properties) {
+      if (!p.isChild() && !includedProperties.contains(p.getName())) {
+        toRemove.add(p);
+      }
+    }
+    properties.removeAll(toRemove);
+  }
+
   private void addReferenceAttributes(AttributesImpl attrs, BaseOBObject referedObject) {
     if (referedObject == null) {
       return;
@@ -663,6 +683,15 @@
     this.optionExportTransientInfo = optionExportTransientInfo;
   }
 
+  /**
+   * 
+   * @param includedProperties
+   *          set to the Names of the properties to be exported
+   */
+  public void setIncludedProperties(List<String> includedProperties) {
+    this.includedProperties = includedProperties;
+  }
+
   public Client getClient() {
     return client;
   }
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Fri Apr 27 14:24:26 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Fri Apr 27 14:25:34 2012 +0200
@@ -1481,7 +1481,7 @@
             data = CreateFromInvoiceData.selectFromPOUpdateSOTrx(conn, this, vars.getLanguage(),
                 ids[k]);
           else
-            data = CreateFromInvoiceData.selectFromPOUpdate(conn, this, strKey, vars.getLanguage(),
+            data = CreateFromInvoiceData.selectFromPOUpdate(conn, this, vars.getLanguage(), strKey,
                 ids[k]);
         }
         if (data != null) {
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql	Fri Apr 27 14:24:26 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql	Fri Apr 27 14:25:34 2012 +0200
@@ -33,7 +33,7 @@
        FROM C_ORDERLINE CO LEFT JOIN C_INVOICELINE CI ON CI.C_ORDERLINE_ID = CO.C_ORDERLINE_ID
        WHERE  CI.C_INVOICE_ID=? AND CO.C_ORDERLINE_ID = l.c_orderline_id
        GROUP BY CI.C_orderline_id , CO.QtyORDERED),0) AS QTY, 
-       l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME AS RELATION_NAME, 
+       l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), to_char(l.m_product_id), to_char(?)) AS RELATION_NAME, 
         l.C_OrderLine_ID,l.Line, l.ad_org_id, '' as STDPRECISION, 
         '' as M_InOutLine_ID, '' AS PriceActual, '' AS PriceList, '' AS PriceLimit, '' AS Description, '' as PriceStd,
         '' AS QUANTITYORDER, '' AS M_Product_UOM_ID, '' AS M_ATTRIBUTESETINSTANCE_ID, '' AS M_Offer_ID, '' AS PricePrecision,
@@ -63,6 +63,7 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="language"/>
+    <Parameter name="language"/>
     <Parameter name="piId"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="o.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="o.AD_Org_ID IN (" text="'1'"/>
@@ -99,7 +100,8 @@
     <Sql>
       <![CDATA[
         SELECT o.C_ORDER_ID as ID, Ad_Column_Identifier(to_char('C_Order'), to_char(o.c_order_id), to_char(?)) AS NAME,o.DocumentNo AS NAMEORDER,
-        l.QtyOrdered-COALESCE(l.QTYINVOICED,0) AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME AS RELATION_NAME, 
+        l.QtyOrdered-COALESCE(l.QTYINVOICED,0) AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,
+	Ad_Column_Identifier(to_char('M_Product'), to_char(l.m_product_id), to_char(?)) AS RELATION_NAME, 
         l.C_OrderLine_ID,l.Line, l.ad_Org_id, l.taxbaseamt
         FROM C_INVOICE_CANDIDATE_V ic, C_UOM uom, C_ORDER o, C_ORDERLINE l, M_PRODUCT p 
         WHERE l.C_UOM_ID=uom.C_UOM_ID
@@ -117,6 +119,7 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="language"/>
+    <Parameter name="language"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="ic.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="ic.AD_Org_ID IN (" text="'1'"/>
     <Parameter name="poId"/>
@@ -153,7 +156,7 @@
         WHERE  CI.C_INVOICE_ID=? AND CO.C_ORDERLINE_ID = l.c_orderline_id
         GROUP BY CI.C_orderline_id , CO.QtyORDERED),0) AS QTY, 
         l.C_UOM_ID, COALESCE(uomt.UOMSYMBOL, uom.UOMSymbol) AS UOMSymbol, 
-        l.M_Product_ID,p.NAME AS RELATION_NAME, l.C_OrderLine_ID,l.Line, l.taxbaseamt 
+        l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), to_char(l.m_product_id), to_char(?)) AS RELATION_NAME, l.C_OrderLine_ID,l.Line, l.taxbaseamt 
         FROM C_UOM uom left join  C_UOM_TRL uomt on uom.C_UOM_ID = uomt.C_UOM_ID
                                                 and uomt.AD_Language = ?,
              C_ORDERLINE l left join M_MATCHPO m on l.C_OrderLine_ID=m.C_OrderLine_ID
@@ -183,9 +186,10 @@
     <Field name="rownum" value="count"/>
     <Parameter name="adLanguage"/>
     <Parameter name="piId"/>
+    <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="o.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="o.AD_Org_ID IN (" text="'1'"/>
-    <Parameter name="adLanguage"/>
     <Parameter name="poId"/>
     <Parameter name="piId"/>
   </SqlMethod>
@@ -195,7 +199,7 @@
       <![CDATA[
         SELECT o.C_ORDER_ID as ID, Ad_Column_Identifier(to_char('C_Order'), to_char(o.c_order_id), to_char(?) ) AS NAME,o.DocumentNo AS NAMEORDER,
         l.QtyOrdered-COALESCE(l.QTYINVOICED,0) AS QTY, l.C_UOM_ID, COALESCE(uomt.UOMSymbol, uom.UOMSymbol) AS UOMSymbol, 
-        l.M_Product_ID,p.NAME AS RELATION_NAME, l.C_OrderLine_ID,l.Line, l.taxbaseamt
+        l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), to_char(l.m_product_id), to_char(?)) AS RELATION_NAME, l.C_OrderLine_ID,l.Line, l.taxbaseamt
         FROM C_UOM uom left join C_UOM_TRL uomt on uom.C_UOM_ID = uomt.C_UOM_ID
                                                and  uomt.AD_Language = ?, 
         C_INVOICE_CANDIDATE_V ic,   C_ORDER o, C_ORDERLINE l, M_PRODUCT p 
@@ -214,6 +218,7 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="ic.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="ic.AD_Org_ID IN (" text="'1'"/>
     <Parameter name="adLanguage"/>
@@ -300,7 +305,7 @@
       <![CDATA[
         SELECT s.M_InOut_ID AS ID, Ad_Column_Identifier(to_char('M_InOut'), to_char(s.M_InOut_ID), to_char(?)) AS NAME, 
         s.DocumentNo AS NAMESHIPMENT, 
-        (l.MovementQty-SUM(COALESCE(mi.Qty,0))) AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME||' '||(CASE WHEN ma.serno IS NOT NULL THEN TO_CHAR('('||' '||ma.serno||' '||')') ELSE TO_CHAR('')  END) AS RELATION_NAME, 
+        (l.MovementQty-SUM(COALESCE(mi.Qty,0))) AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), to_char(l.m_product_id), to_char(?))||' '||(CASE WHEN ma.serno IS NOT NULL THEN TO_CHAR('('||' '||ma.serno||' '||')') ELSE TO_CHAR('')  END) AS RELATION_NAME, 
         l.M_InOutLine_ID,l.Line, l.M_InOutLine_ID as C_OrderLine_ID
         FROM M_INOUTLINE l left join M_ATTRIBUTESETINSTANCE ma on l.M_ATTRIBUTESETINSTANCE_ID = ma.M_ATTRIBUTESETINSTANCE_ID
                            left join M_MATCHINV mi             on l.M_InOutLine_ID=mi.M_InOutLine_ID,
@@ -321,6 +326,7 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="s.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="s.AD_Org_ID IN (" text="'1'"/>
     <Parameter name="mInoutId"/>
@@ -357,7 +363,7 @@
       <![CDATA[
         SELECT s.M_InOut_ID AS ID, Ad_Column_Identifier(to_char('M_InOut'), to_char(s.M_InOut_ID), to_char(?)) AS NAME,
         s.DocumentNo AS NAMESHIPMENT,
-        l.MovementQty AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME||' '||(CASE WHEN ma.serno IS NOT NULL THEN TO_CHAR('('||' '||ma.serno||' '||')') ELSE TO_CHAR('') END) AS RELATION_NAME, l.M_InOutLine_ID,l.Line,
+        l.MovementQty AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), to_char(l.m_product_id), to_char(?))||' '||(CASE WHEN ma.serno IS NOT NULL THEN TO_CHAR('('||' '||ma.serno||' '||')') ELSE TO_CHAR('') END) AS RELATION_NAME, l.M_InOutLine_ID,l.Line,
         l.M_InOutLine_ID as C_OrderLine_ID 
         FROM M_INOUTLINE l left join M_ATTRIBUTESETINSTANCE ma on l.M_ATTRIBUTESETINSTANCE_ID = ma.M_ATTRIBUTESETINSTANCE_ID,
         M_INOUT s, C_UOM uom, M_PRODUCT p 
@@ -377,6 +383,7 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="s.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="s.AD_Org_ID IN (" text="'1'"/>
     <Parameter name="mInoutId"/>
@@ -421,7 +428,7 @@
       SELECT s.M_InOut_ID AS ID, Ad_Column_Identifier(to_char('M_InOut'), to_char(s.M_InOut_ID), to_char(?)) AS NAME,
       s.DocumentNo AS NAMESHIPMENT,
         (l.MovementQty-SUM(COALESCE(mi.Qty,0))) AS QTY, l.C_UOM_ID, COALESCE(uomt.UOMSymbol, uom.UOMSymbol) AS UOMSymbol, 
-        l.M_Product_ID,p.NAME||' '||(CASE WHEN ma.serno IS NOT NULL THEN TO_CHAR('('||' '||ma.serno||' '||')') ELSE TO_CHAR('')  END) AS RELATION_NAME, l.M_InOutLine_ID,l.Line, l.M_InOutLine_ID as C_OrderLine_ID 
+        l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), to_char(l.m_product_id), to_char(?))||' '||(CASE WHEN ma.serno IS NOT NULL THEN TO_CHAR('('||' '||ma.serno||' '||')') ELSE TO_CHAR('')  END) AS RELATION_NAME, l.M_InOutLine_ID,l.Line, l.M_InOutLine_ID as C_OrderLine_ID 
         FROM M_INOUTLINE l left join M_ATTRIBUTESETINSTANCE ma on l.M_ATTRIBUTESETINSTANCE_ID = ma.M_ATTRIBUTESETINSTANCE_ID
                            left join M_MATCHINV mi             on l.M_InOutLine_ID=mi.M_InOutLine_ID,
              C_UOM uom     left join C_UOM_TRL uomt            on uom.C_UOM_ID = uomt.C_UOM_ID
@@ -443,9 +450,10 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="s.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="s.AD_Org_ID IN (" text="'1'"/>
-    <Parameter name="adLanguage"/>
     <Parameter name="mInoutId"/>
   </SqlMethod>
   <SqlMethod name="selectFromShipmentTrlSOTrx" type="preparedStatement" return="multiple">
@@ -455,7 +463,7 @@
         SELECT s.M_InOut_ID AS ID, Ad_Column_Identifier(to_char('M_InOut'), to_char(s.M_InOut_ID), to_char(?)) AS NAME,
         s.DocumentNo AS NAMESHIPMENT, 
         l.MovementQty AS QTY, l.C_UOM_ID,COALESCE(uomt.UOMSymbol, uom.UOMSymbol) AS UOMSymbol, 
-        l.M_Product_ID,p.NAME||' '|| (CASE WHEN ma.serno IS NOT NULL THEN TO_CHAR('('||' '||ma.serno||' '||')') ELSE TO_CHAR('')  END) AS RELATION_NAME, l.M_InOutLine_ID,l.Line, l.M_InOutLine_ID as C_OrderLine_ID 
+        l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), to_char(l.m_product_id), to_char(?))||' '|| (CASE WHEN ma.serno IS NOT NULL THEN TO_CHAR('('||' '||ma.serno||' '||')') ELSE TO_CHAR('')  END) AS RELATION_NAME, l.M_InOutLine_ID,l.Line, l.M_InOutLine_ID as C_OrderLine_ID 
         FROM M_INOUTLINE l left join M_ATTRIBUTESETINSTANCE ma on l.M_ATTRIBUTESETINSTANCE_ID = ma.M_ATTRIBUTESETINSTANCE_ID,
              C_UOM uom     left join C_UOM_TRL uomt            on uom.C_UOM_ID = uomt.C_UOM_ID
                                                               and uomt.AD_Language = ? ,
@@ -476,9 +484,10 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="s.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="s.AD_Org_ID IN (" text="'1'"/>
-    <Parameter name="adLanguage"/>
     <Parameter name="mInoutId"/>
   </SqlMethod>
   <SqlMethod name="selectFromShipmentUpdate" type="preparedStatement" connection="true" return="multiple">
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql	Fri Apr 27 14:24:26 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql	Fri Apr 27 14:25:34 2012 +0200
@@ -28,7 +28,8 @@
     <Sql>
       <![CDATA[
         SELECT o.C_ORDER_ID, Ad_Column_Identifier(TO_CHAR('C_Order'), TO_CHAR(o.c_order_id), TO_CHAR(?)) AS NAME, 
-        l.QtyOrdered-SUM(COALESCE(m.Qty,0)) AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME AS RELATION_NAME, 
+        l.QtyOrdered-SUM(COALESCE(m.Qty,0)) AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,
+	Ad_Column_Identifier(TO_CHAR('M_Product'), TO_CHAR(l.m_product_id), TO_CHAR(?)) AS RELATION_NAME, 
         l.C_OrderLine_ID,l.Line, l.ad_org_id, '' as C_InvoiceLine_ID, '' as M_InOutLine_ID, '' AS BREAKDOWN, '' AS STDPRECISION, 
         '' AS C_UOM_ID_Conversion, '' AS QUANTITYORDER, '' AS M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID AS M_ATTRIBUTESETINSTANCE_ID, 
         l.C_OrderLine_ID AS ID, '' AS C_Invoice_ID, l.DESCRIPTION AS DESCRIPTION,
@@ -59,6 +60,7 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="language"/>
+    <Parameter name="language"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="o.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="o.AD_Org_ID IN (" text="'1'"/>
     <Parameter name="poId"/>
@@ -94,7 +96,8 @@
     <Sql>
       <![CDATA[
         SELECT o.C_ORDER_ID, Ad_Column_Identifier(TO_CHAR('C_Order'), TO_CHAR(o.c_order_id), TO_CHAR(?)) AS NAME, 
-        l.QtyOrdered-COALESCE(l.qtydelivered,0) AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME AS RELATION_NAME, 
+        l.QtyOrdered-COALESCE(l.qtydelivered,0) AS QTY, l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,
+	Ad_Column_Identifier(TO_CHAR('M_Product'), TO_CHAR(l.m_product_id), TO_CHAR(?)) AS RELATION_NAME, 
         l.C_OrderLine_ID,l.Line, l.C_OrderLine_ID AS ID, l.DESCRIPTION AS DESCRIPTION
         FROM M_INOUT_CANDIDATE_V ic, C_ORDER o, C_UOM uom, C_ORDERLINE l, M_PRODUCT p 
         WHERE o.C_ORDER_ID = l.C_ORDER_ID
@@ -112,6 +115,7 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="language"/>
+    <Parameter name="language"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="ic.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="ic.AD_Org_ID IN (" text="'1'"/>
     <Parameter name="poId"/>
@@ -142,7 +146,7 @@
       <![CDATA[
       SELECT o.C_ORDER_ID, Ad_Column_Identifier(TO_CHAR('C_Order'), TO_CHAR(o.c_order_id), TO_CHAR(?)) AS NAME, 
         l.QtyOrdered-SUM(COALESCE(m.Qty,0)) AS QTY, l.C_UOM_ID,COALESCE(uomt.UOMSymbol, uom.UOMSymbol) AS UOMSymbol, l.M_Product_ID,
-        p.NAME AS RELATION_NAME, l.C_OrderLine_ID, l.Line, l.C_OrderLine_ID AS ID, l.DESCRIPTION AS DESCRIPTION,
+        Ad_Column_Identifier(TO_CHAR('M_Product'), TO_CHAR(l.m_product_id), TO_CHAR(?)) AS RELATION_NAME, l.C_OrderLine_ID, l.Line, l.C_OrderLine_ID AS ID, l.DESCRIPTION AS DESCRIPTION,
         ((l.QtyOrdered-SUM(COALESCE(m.Qty,0)))/COALESCE(
         (SELECT MULTIPLYRATE FROM C_UOM_CONVERSION WHERE C_UOM_CONVERSION.C_UOM_ID =
         (SELECT C_UOM.C_UOM_ID FROM M_PRODUCT_UOM, C_UOM WHERE M_PRODUCT_UOM_ID = l.M_PRODUCT_UOM_ID AND M_PRODUCT_UOM.C_UOM_ID = C_UOM.C_UOM_ID)        
@@ -173,9 +177,10 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="language"/>
+    <Parameter name="language"/>
+    <Parameter name="language"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="o.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="o.AD_Org_ID IN (" text="'1'"/>
-    <Parameter name="language"/>
     <Parameter name="poId"/>
   </SqlMethod>
   <SqlMethod name="selectFromPOTrlSOTrx" type="preparedStatement" return="multiple">
@@ -184,7 +189,7 @@
       <![CDATA[
         SELECT o.C_ORDER_ID, Ad_Column_Identifier(TO_CHAR('C_Order'), TO_CHAR(o.c_order_id), TO_CHAR(?)) AS NAME, 
         l.QtyOrdered-COALESCE(l.qtydelivered,0) AS QTY, l.C_UOM_ID, COALESCE(uomt.UOMSymbol, uom.UOMSymbol) AS UOMSymbol, 
-        l.M_Product_ID,p.NAME AS RELATION_NAME, l.C_OrderLine_ID, l.Line, l.C_OrderLine_ID AS ID, l.DESCRIPTION AS DESCRIPTION
+        l.M_Product_ID,Ad_Column_Identifier(TO_CHAR('M_Product'), TO_CHAR(l.m_product_id), TO_CHAR(?)) AS RELATION_NAME, l.C_OrderLine_ID, l.Line, l.C_OrderLine_ID AS ID, l.DESCRIPTION AS DESCRIPTION
         FROM C_UOM uom left join C_UOM_TRL uomt on uom.C_UOM_ID = uomt.C_UOM_ID
                                                 and uomt.AD_Language = ?,
         M_INOUT_CANDIDATE_V ic, C_ORDER o,   C_ORDERLINE l, M_PRODUCT p 
@@ -203,9 +208,10 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="language"/>
+    <Parameter name="language"/>
+    <Parameter name="language"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="ic.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="ic.AD_Org_ID IN (" text="'1'"/>
-    <Parameter name="language"/>
     <Parameter name="poId"/>
   </SqlMethod>
   <SqlMethod name="selectFromPOUpdate" type="preparedStatement" connection="true" return="multiple">
@@ -263,7 +269,8 @@
       <![CDATA[
         SELECT i.C_Invoice_ID, Ad_Column_Identifier(TO_CHAR('C_Invoice'), TO_CHAR(i.C_Invoice_ID), TO_CHAR(?)) AS NAME, 
         l.QtyInvoiced-SUM(COALESCE(mi.Qty,0)) AS QTY, l.C_UOM_ID,uom.UOMSymbol,
-        l.M_Product_ID,p.NAME AS RELATION_NAME, l.C_InvoiceLine_ID,l.Line, l.C_OrderLine_ID, l.C_InvoiceLine_ID AS ID, l.DESCRIPTION AS DESCRIPTION,
+        l.M_Product_ID,Ad_Column_Identifier(TO_CHAR('M_Product'), TO_CHAR(l.m_product_id), TO_CHAR(?)) AS RELATION_NAME, 
+	l.C_InvoiceLine_ID,l.Line, l.C_OrderLine_ID, l.C_InvoiceLine_ID AS ID, l.DESCRIPTION AS DESCRIPTION,
         (l.QtyInvoiced-SUM(COALESCE(mi.Qty,0))/COALESCE(
         (SELECT MULTIPLYRATE FROM C_UOM_CONVERSION WHERE C_UOM_CONVERSION.C_UOM_ID =
         (SELECT C_UOM.C_UOM_ID FROM M_PRODUCT_UOM, C_UOM WHERE M_PRODUCT_UOM_ID = l.M_PRODUCT_UOM_ID AND M_PRODUCT_UOM.C_UOM_ID = C_UOM.C_UOM_ID)        
@@ -289,6 +296,7 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="language"/>
+    <Parameter name="language"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="i.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="i.AD_Org_ID IN (" text="'1'"/>
     <Parameter name="cInvoiceId"/>
@@ -299,7 +307,8 @@
       <![CDATA[
         SELECT i.C_Invoice_ID, Ad_Column_Identifier(TO_CHAR('C_Invoice'), TO_CHAR(i.C_Invoice_ID), TO_CHAR(?)) AS NAME, 
         l.QtyInvoiced-SUM(COALESCE(mi.MOVEMENTQTY,0)) AS QTY, l.C_UOM_ID,uom.UOMSymbol,
-        l.M_Product_ID,p.NAME AS RELATION_NAME, l.C_InvoiceLine_ID,l.Line, l.C_OrderLine_ID, l.C_InvoiceLine_ID AS ID, 
+        l.M_Product_ID,Ad_Column_Identifier(TO_CHAR('M_Product'), TO_CHAR(l.m_product_id), TO_CHAR(?)) AS RELATION_NAME, 
+	l.C_InvoiceLine_ID,l.Line, l.C_OrderLine_ID, l.C_InvoiceLine_ID AS ID, 
         l.DESCRIPTION AS DESCRIPTION
         FROM C_INVOICELINE l left join M_INOUTLINE mi on l.M_INOUTLINE_ID = mi.M_INOUTLINE_ID,
         C_INVOICE i, C_UOM uom,  M_PRODUCT p
@@ -317,6 +326,7 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="language"/>
+    <Parameter name="language"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="i.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="i.AD_Org_ID IN (" text="'1'"/>
     <Parameter name="cInvoiceId"/>
@@ -375,7 +385,7 @@
       <![CDATA[
         SELECT i.C_Invoice_ID, Ad_Column_Identifier(TO_CHAR('C_Invoice'), TO_CHAR(i.C_Invoice_ID), TO_CHAR(?)) AS NAME, 
         l.QtyInvoiced-SUM(COALESCE(mi.Qty,0)) AS QTY, l.C_UOM_ID,COALESCE(uomt.UOMSymbol, uom.UOMSymbol) AS UOMSymbol,
-        l.M_Product_ID,p.NAME AS RELATION_NAME, l.C_InvoiceLine_ID,l.Line, l.C_OrderLine_ID, l.C_InvoiceLine_ID AS ID, 
+        l.M_Product_ID,Ad_Column_Identifier(TO_CHAR('M_Product'), TO_CHAR(l.m_product_id), TO_CHAR(?)) AS RELATION_NAME, l.C_InvoiceLine_ID,l.Line, l.C_OrderLine_ID, l.C_InvoiceLine_ID AS ID, 
         l.DESCRIPTION AS DESCRIPTION,
         (l.QtyInvoiced-SUM(COALESCE(mi.Qty,0))/COALESCE(
         (SELECT MULTIPLYRATE FROM C_UOM_CONVERSION WHERE C_UOM_CONVERSION.C_UOM_ID =
@@ -404,9 +414,10 @@
     </Sql>
     <Field name="rownum" value="count"/>
     <Parameter name="language"/>
+    <Parameter name="language"/>
+    <Parameter name="language"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="i.AD_Client_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="i.AD_Org_ID IN (" text="'1'"/>
-    <Parameter name="language"/>
     <Parameter name="cInvoiceId"/>
   </SqlMethod>
   <SqlMethod name="selectFromInvoiceUpdate" type="preparedStatement" connection="true" return="multiple">