src/org/openbravo/erpCommon/info/Locator_data.xsql
changeset 712 aa0c40278c5a
parent 423 ecf368072c48
child 1605 8a0fe0193bef
--- a/src/org/openbravo/erpCommon/info/Locator_data.xsql	Mon Apr 21 19:03:40 2008 +0000
+++ b/src/org/openbravo/erpCommon/info/Locator_data.xsql	Mon Apr 21 19:06:47 2008 +0000
@@ -28,18 +28,23 @@
       <SqlMethodComment></SqlMethodComment>
       <Sql>
       <![CDATA[
+      SELECT * FROM ( SELECT '0' AS RN1, A.* FROM (      				   
         SELECT m.M_LOCATOR_ID, mw.NAME, m.VALUE, REPLACE(AD_COLUMN_IDENTIFIER(TO_CHAR('M_LOCATOR'), TO_CHAR(m.M_LOCATOR_ID), TO_CHAR(?)), '''', chr(92)||'''') AS VALUE_HIDDEN, m.PRIORITYNO, 
-        m.ISDEFAULT, m.X AS aisle, m.Y AS bin, m.Z AS nivel
+        m.ISDEFAULT, m.X AS aisle, m.Y AS bin, m.Z AS nivel,
+        m.M_LOCATOR_ID || '#' || m.value  AS rowKey
         FROM M_LOCATOR m, M_WAREHOUSE mw
         WHERE m.M_WAREHOUSE_ID = mw.M_WAREHOUSE_ID
         AND mw.AD_Client_ID IN ('1') 
         AND mw.AD_Org_ID IN ('1') 
         AND mw.ISACTIVE = 'Y'
         AND m.ISACTIVE = 'Y'
-        ORDER BY mw.NAME, m.PRIORITYNO, m.VALUE, m.X, m.Y, m.Z
+        ORDER BY m.M_LOCATOR_ID
+		) A ) B
+		WHERE 1=1
         ]]>
         </Sql>
         <Field name="position" value="count"/>
+        <Parameter name="rownum" type="replace" optional="true" after="FROM ( SELECT " text="'0'" />
         <Parameter name="adLanguage"/>
         <Parameter name="adUserClient" type="replace" optional="true" after="mw.AD_Client_ID IN (" text="'1'"/>
         <Parameter name="adUserOrg" type="replace" optional="true" after="mw.AD_Org_ID IN (" text="'1'"/>
@@ -48,6 +53,9 @@
         <Parameter name="aisle" optional="true" after="AND m.ISACTIVE = 'Y'"><![CDATA[ AND UPPER(m.X) LIKE UPPER(?) ]]></Parameter>
         <Parameter name="bin" optional="true" after="AND m.ISACTIVE = 'Y'"><![CDATA[ AND UPPER(m.Y) LIKE UPPER(?) ]]></Parameter>
         <Parameter name="level" optional="true" after="AND m.ISACTIVE = 'Y'"><![CDATA[ AND UPPER(m.Z) LIKE UPPER(?) ]]></Parameter>
+        <Parameter name="orderBy" type="replace" optional="true" after="ORDER BY " text="m.M_LOCATOR_ID" />
+        <Parameter name="oraLimit" type="argument" optional="true" after="WHERE 1=1"><![CDATA[AND RN1 BETWEEN ]]></Parameter>
+        <Parameter name="pgLimit" type="argument" optional="true" after="WHERE 1=1"><![CDATA[LIMIT ]]></Parameter>
    </SqlMethod>
    <SqlMethod name="set" type="constant" return="multiple">
       <SqlMethodComment></SqlMethodComment>