src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJR_data.xsql
author David Baz Fayos <david.baz@openbravo.com>
Tue, 27 May 2008 15:26:10 +0000
changeset 1044 8691bbc94032
parent 573 48f214c7b66e
child 1605 8a0fe0193bef
permissions -rw-r--r--
Removed old frame parameter of windowTableId
carlos@0
     1
<?xml version="1.0" encoding="UTF-8" ?>
carlos@0
     2
<!--
carlos@0
     3
 *************************************************************************
carlos@0
     4
 * The contents of this file are subject to the Openbravo  Public  License
carlos@0
     5
 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
carlos@0
     6
 * Version 1.1  with a permitted attribution clause; you may not  use this
carlos@0
     7
 * file except in compliance with the License. You  may  obtain  a copy of
carlos@0
     8
 * the License at http://www.openbravo.com/legal/license.html 
carlos@0
     9
 * Software distributed under the License  is  distributed  on  an "AS IS"
carlos@0
    10
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
carlos@0
    11
 * License for the specific  language  governing  rights  and  limitations
carlos@0
    12
 * under the License. 
carlos@0
    13
 * The Original Code is Openbravo ERP. 
carlos@0
    14
 * The Initial Developer of the Original Code is Openbravo SL 
carlos@0
    15
 * All portions are Copyright (C) 2001-2006 Openbravo SL 
carlos@0
    16
 * All Rights Reserved. 
carlos@0
    17
 * Contributor(s):  ______________________________________.
carlos@0
    18
 ************************************************************************
carlos@0
    19
-->
carlos@0
    20
carlos@0
    21
<SqlClass name="ReportShipmentDimensionalAnalyzeJRData" package="org.openbravo.erpCommon.ad_reports">
carlos@0
    22
  <SqlClassComment></SqlClassComment>
carlos@0
    23
  <SqlMethod name="select" type="preparedStatement" return="multiple">
carlos@0
    24
    <SqlMethodComment></SqlMethodComment>
carlos@0
    25
    <Sql>
carlos@0
    26
    <![CDATA[
carlos@0
    27
      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, SUM(LINENETAMT) AS AMOUNT, SUM(MOVEMENTQTY) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(LINENETREF) AS AMOUNTREF, SUM(MOVEMENTQTYREF) AS QTYREF, SUM(WEIGHTREF) AS WEIGHTREF, '' AS ID, '' AS NAME, UOMSYMBOL
carlos@0
    28
      FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('18') AS NIVEL8, to_char('19') AS NIVEL9, 
carlos@0
    29
      COALESCE(M_INOUTLINE.MOVEMENTQTY*C_ORDERLINE.PRICEACTUAL,NULL) AS LINENETAMT, M_INOUTLINE.MOVEMENTQTY, M_INOUTLINE.MOVEMENTQTY*M_PRODUCT.WEIGHT AS WEIGHT, 0 AS LINENETREF, 0 AS MOVEMENTQTYREF, 0 AS WEIGHTREF, C_UOM.UOMSYMBOL
carlos@0
    30
      FROM M_INOUTLINE left join C_ORDERLINE on M_INOUTLINE.C_ORDERLINE_ID = C_ORDERLINE.C_ORDERLINE_ID ,
carlos@0
    31
           M_INOUT left join AD_USER on M_INOUT.SALESREP_ID = AD_USER.AD_USER_ID,
carlos@0
    32
           C_BPARTNER left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID,
carlos@0
    33
          C_BP_GROUP,  M_PRODUCT, M_PRODUCT_CATEGORY, M_WAREHOUSE, C_UOM,  AD_ORG
carlos@0
    34
      WHERE M_INOUT.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
carlos@0
    35
      AND C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
carlos@0
    36
      AND M_INOUT.M_INOUT_ID = M_INOUTLINE.M_INOUT_ID
carlos@0
    37
      AND M_INOUTLINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
carlos@0
    38
      AND M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
carlos@0
    39
      AND M_INOUT.M_WAREHOUSE_ID = M_WAREHOUSE.M_WAREHOUSE_ID
carlos@0
    40
      AND M_INOUTLINE.C_UOM_ID = C_UOM.C_UOM_ID
carlos@0
    41
      AND M_INOUT.AD_ORG_ID = AD_ORG.AD_ORG_ID
carlos@0
    42
      AND M_INOUT.ISSOTRX = 'Y'
carlos@0
    43
      AND M_INOUT.PROCESSED = 'Y'
carlos@0
    44
      AND 0=0 AND M_INOUT.AD_ORG_ID IN ('1')
carlos@0
    45
      AND M_INOUT.AD_CLIENT_ID IN ('8')
carlos@0
    46
      AND 1=1
carlos@0
    47
      UNION ALL SELECT to_char('9') AS NIVEL1 , to_char('10') AS NIVEL2 , to_char('11') AS NIVEL3 , to_char('12') AS NIVEL4 , to_char('13') AS NIVEL5 , to_char('14') AS NIVEL6 , to_char('15') AS NIVEL7 , to_char('20') AS NIVEL8 , to_char('21') AS NIVEL9, 
carlos@0
    48
      0 AS LINENETAMT, 0 AS MOVEMENTQTY, 0 AS WEIGHT, COALESCE(M_INOUTLINE.MOVEMENTQTY*C_ORDERLINE.PRICEACTUAL,NULL) AS LINENETREF, M_INOUTLINE.MOVEMENTQTY AS MOVEMENTQTYREF, M_INOUTLINE.MOVEMENTQTY*M_PRODUCT.WEIGHT AS WEIGHTREF, C_UOM.UOMSYMBOL
carlos@0
    49
      FROM M_INOUTLINE left join C_ORDERLINE on M_INOUTLINE.C_ORDERLINE_ID = C_ORDERLINE.C_ORDERLINE_ID,
carlos@0
    50
           M_INOUT left join AD_USER on M_INOUT.SALESREP_ID = AD_USER.AD_USER_ID,
carlos@0
    51
           C_BPARTNER left join  C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID,
carlos@0
    52
       C_BP_GROUP, M_PRODUCT, M_PRODUCT_CATEGORY, M_WAREHOUSE, C_UOM,   AD_ORG
carlos@0
    53
      WHERE M_INOUT.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
carlos@0
    54
      AND C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
carlos@0
    55
      AND M_INOUT.M_INOUT_ID = M_INOUTLINE.M_INOUT_ID
carlos@0
    56
      AND M_INOUTLINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
carlos@0
    57
      AND M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
carlos@0
    58
      AND M_INOUT.M_WAREHOUSE_ID = M_WAREHOUSE.M_WAREHOUSE_ID
carlos@0
    59
      AND M_INOUTLINE.C_UOM_ID = C_UOM.C_UOM_ID
carlos@0
    60
      AND M_INOUT.AD_ORG_ID = AD_ORG.AD_ORG_ID
carlos@0
    61
      AND M_INOUT.ISSOTRX = 'Y'
carlos@0
    62
      AND M_INOUT.PROCESSED = 'Y'
carlos@0
    63
      AND 3=3 AND M_INOUT.AD_ORG_ID IN ('1')
carlos@0
    64
      AND M_INOUT.AD_CLIENT_ID IN('16')
carlos@0
    65
      AND 2=2) AA
carlos@0
    66
      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, UOMSYMBOL, 1
carlos@0
    67
     ]]></Sql>
carlos@0
    68
    <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
carlos@0
    69
    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
carlos@0
    70
    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
carlos@0
    71
    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3, to_char(" text="'4'"/>
carlos@0
    72
    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4, to_char(" text="'5'"/>
carlos@0
    73
    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5, to_char(" text="'6'"/>
carlos@0
    74
    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6, to_char(" text="'7'"/>
carlos@0
    75
    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7, to_char(" text="'18'"/>
carlos@0
    76
    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8, to_char(" text="'19'"/>
carlos@0
    77
    <Parameter name="adOrgId" optional="true" type="replace" after="AND 0=0 AND M_INOUT.AD_ORG_ID IN (" text="'1'"/>
carlos@0
    78
    <Parameter name="adUserClient" type="replace" optional="true" after="AND M_INOUT.AD_CLIENT_ID IN (" text="'8'"/>
carlos@0
    79
    <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND M_INOUT.MOVEMENTDATE >= TO_DATE(?)]]></Parameter>
carlos@0
    80
    <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND M_INOUT.MOVEMENTDATE < TO_DATE(?)]]></Parameter>
carlos@423
    81
    <Parameter name="cBpartnerGroupId" optional="true" after="AND 1=1"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
    82
    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
carlos@423
    83
    <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
    84
    <Parameter name="mProductId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
carlos@423
    85
    <Parameter name="mWarehouseId" optional="true" after="AND 1=1"><![CDATA[AND M_WAREHOUSE.M_WAREHOUSE_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
    86
    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND M_INOUT.SALESREP_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
    87
    <Parameter name="partnerSalesrepId" optional="true" after="AND 1=1"><![CDATA[AND CB.C_BPARTNER_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
    88
    <Parameter name="nivel1" type="replace" optional="true" after="UNION ALL SELECT to_char(" text="'9'"/>
carlos@0
    89
    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1 , to_char(" text="'10'"/>
carlos@0
    90
    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2 , to_char(" text="'11'"/>
carlos@0
    91
    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3 , to_char(" text="'12'"/>
carlos@0
    92
    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4 , to_char(" text="'13'"/>
carlos@0
    93
    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5 , to_char(" text="'14'"/>
carlos@0
    94
    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6 , to_char(" text="'15'"/>
carlos@0
    95
    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7 , to_char(" text="'20'"/>
carlos@0
    96
    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8 , to_char(" text="'21'"/>
carlos@0
    97
    <Parameter name="adOrgId" optional="true" type="replace" after="AND 3=3 AND M_INOUT.AD_ORG_ID IN (" text="'1'"/>
carlos@0
    98
    <Parameter name="adUserClient" type="replace" optional="true" after="AND M_INOUT.AD_CLIENT_ID IN(" text="'16'"/>
carlos@0
    99
    <Parameter name="dateFromRef" optional="true" after="AND 2=2"><![CDATA[AND M_INOUT.MOVEMENTDATE >= TO_DATE(?)]]></Parameter>
carlos@0
   100
    <Parameter name="dateToRef" optional="true" after="AND 2=2"><![CDATA[AND M_INOUT.MOVEMENTDATE < TO_DATE(?)]]></Parameter>
carlos@423
   101
    <Parameter name="cBpartnerGroupId" optional="true" after="AND 2=2"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   102
    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
carlos@423
   103
    <Parameter name="mProductCategoryId" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   104
    <Parameter name="mProductId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
carlos@423
   105
    <Parameter name="mWarehouseId" optional="true" after="AND 2=2"><![CDATA[AND M_WAREHOUSE.M_WAREHOUSE_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
   106
    <Parameter name="salesrepId" optional="true" after="AND 2=2"><![CDATA[AND M_INOUT.SALESREP_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
   107
    <Parameter name="partnerSalesrepId" optional="true" after="AND 2=2"><![CDATA[AND CB.C_BPARTNER_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   108
    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, UOMSYMBOL" text=", 1"/>
carlos@0
   109
  </SqlMethod>
carlos@0
   110
  <SqlMethod name="set" type="constant" return="multiple">
carlos@0
   111
      <SqlMethodComment></SqlMethodComment>
carlos@0
   112
      <Sql></Sql>
carlos@0
   113
  </SqlMethod>
carlos@0
   114
  <SqlMethod name="selectNoComparative" type="preparedStatement" return="multiple">
carlos@0
   115
    <SqlMethodComment></SqlMethodComment>
carlos@0
   116
    <Sql>
carlos@0
   117
    <![CDATA[
carlos@0
   118
      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, SUM(LINENETAMT) AS AMOUNT, SUM(MOVEMENTQTY) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(LINENETREF) AS AMOUNTREF, SUM(MOVEMENTQTYREF) AS QTYREF, SUM(WEIGHTREF) AS WEIGHTREF, '' AS ID, '' AS NAME, UOMSYMBOL
carlos@0
   119
      FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('10') AS NIVEL8, to_char('11') AS NIVEL9, 
carlos@0
   120
      COALESCE(M_INOUTLINE.MOVEMENTQTY*C_ORDERLINE.PRICEACTUAL,NULL) AS LINENETAMT, M_INOUTLINE.MOVEMENTQTY, M_INOUTLINE.MOVEMENTQTY*M_PRODUCT.WEIGHT AS WEIGHT, 0 AS LINENETREF, 0 AS MOVEMENTQTYREF, 0 AS WEIGHTREF, C_UOM.UOMSYMBOL
carlos@0
   121
      FROM M_INOUTLINE left join C_ORDERLINE on M_INOUTLINE.C_ORDERLINE_ID = C_ORDERLINE.C_ORDERLINE_ID,
carlos@0
   122
           M_INOUT left join AD_USER on M_INOUT.SALESREP_ID = AD_USER.AD_USER_ID,
carlos@0
   123
           C_BPARTNER left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID,
carlos@0
   124
       C_BP_GROUP,  M_PRODUCT, M_PRODUCT_CATEGORY, M_WAREHOUSE, C_UOM,  AD_ORG 
carlos@0
   125
      WHERE M_INOUT.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
carlos@0
   126
      AND C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
carlos@0
   127
      AND M_INOUT.M_INOUT_ID = M_INOUTLINE.M_INOUT_ID
carlos@0
   128
      AND M_INOUTLINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
carlos@0
   129
      AND M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
carlos@0
   130
      AND M_INOUT.M_WAREHOUSE_ID = M_WAREHOUSE.M_WAREHOUSE_ID
carlos@0
   131
      AND M_INOUTLINE.C_UOM_ID = C_UOM.C_UOM_ID
carlos@0
   132
      AND M_INOUT.AD_ORG_ID = AD_ORG.AD_ORG_ID
carlos@0
   133
      AND M_INOUT.ISSOTRX = 'Y'
carlos@0
   134
      AND M_INOUT.PROCESSED = 'Y'
carlos@0
   135
      AND 0=0 AND M_INOUT.AD_ORG_ID IN ('1')
carlos@0
   136
      AND M_INOUT.AD_CLIENT_ID IN ('8')
carlos@0
   137
      AND 1=1) AA
carlos@0
   138
      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, UOMSYMBOL, 1
carlos@0
   139
     ]]></Sql>
carlos@0
   140
    <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
carlos@0
   141
    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
carlos@0
   142
    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
carlos@0
   143
    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3, to_char(" text="'4'"/>
carlos@0
   144
    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4, to_char(" text="'5'"/>
carlos@0
   145
    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5, to_char(" text="'6'"/>
carlos@0
   146
    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6, to_char(" text="'7'"/>
carlos@0
   147
    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7, to_char(" text="'10'"/>
carlos@0
   148
    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8, to_char(" text="'11'"/>
carlos@0
   149
    <Parameter name="adOrgId" optional="true" type="replace" after="AND 0=0 AND M_INOUT.AD_ORG_ID IN (" text="'1'"/>
carlos@0
   150
    <Parameter name="adUserClient" type="replace" optional="true" after="AND M_INOUT.AD_CLIENT_ID IN (" text="'8'"/>
carlos@0
   151
    <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND M_INOUT.MOVEMENTDATE >= TO_DATE(?)]]></Parameter>
carlos@0
   152
    <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND M_INOUT.MOVEMENTDATE < TO_DATE(?)]]></Parameter>
carlos@423
   153
    <Parameter name="cBpartnerGroupId" optional="true" after="AND 1=1"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   154
    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
carlos@423
   155
    <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   156
    <Parameter name="mProductId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
carlos@423
   157
    <Parameter name="mWarehouseId" optional="true" after="AND 1=1"><![CDATA[AND M_WAREHOUSE.M_WAREHOUSE_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
   158
    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND M_INOUT.SALESREP_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
   159
    <Parameter name="partnerSalesrepId" optional="true" after="AND 1=1"><![CDATA[AND CB.C_BPARTNER_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   160
    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, UOMSYMBOL" text=", 1"/>
carlos@0
   161
  </SqlMethod>
carlos@0
   162
  <SqlMethod name="selectBpartner" type="preparedStatement" return="multiple">
carlos@0
   163
    <SqlMethodComment></SqlMethodComment>
carlos@0
   164
    <Sql>
carlos@0
   165
    <![CDATA[
carlos@0
   166
      SELECT C_BPARTNER_ID AS ID, C_BPARTNER.NAME
carlos@0
   167
      FROM C_BPARTNER
carlos@0
   168
      WHERE AD_ORG_ID IN ('1') 
carlos@0
   169
      AND AD_CLIENT_ID IN ('1') 
carlos@0
   170
      AND (1=2 )
carlos@0
   171
     ]]></Sql>
carlos@0
   172
    <Parameter name="adOrgClient" type="replace" optional="true" after="AD_ORG_ID IN (" text="'1'"/>
carlos@0
   173
     <Parameter name="adUserClient" type="replace" optional="true" after="AND AD_CLIENT_ID IN (" text="'1'"/>
carlos@0
   174
     <Parameter name="cBpartnerId" optional="true" type="argument" after="(1=2" text=" OR C_BPARTNER_ID IN"/>
carlos@0
   175
  </SqlMethod>
carlos@0
   176
carlos@0
   177
  <SqlMethod name="selectMproduct" type="preparedStatement" return="multiple">
carlos@0
   178
    <SqlMethodComment></SqlMethodComment>
carlos@0
   179
    <Sql>
carlos@0
   180
    <![CDATA[
carlos@0
   181
      SELECT M_PRODUCT.M_PRODUCT_ID AS ID,M_PRODUCT.NAME
carlos@0
   182
      FROM M_PRODUCT
carlos@0
   183
      WHERE AD_ORG_ID IN ('1') 
carlos@0
   184
      AND AD_CLIENT_ID IN ('1') 
carlos@0
   185
      AND (1=2 )
carlos@0
   186
     ]]></Sql>
carlos@0
   187
    <Parameter name="adOrgClient" type="replace" optional="true" after="AD_ORG_ID IN (" text="'1'"/>
carlos@0
   188
     <Parameter name="adUserClient" type="replace" optional="true" after="AND AD_CLIENT_ID IN (" text="'1'"/>
carlos@0
   189
     <Parameter name="mProductId" optional="true" type="argument" after="(1=2" text=" OR M_PRODUCT_ID IN"/>
carlos@0
   190
  </SqlMethod>
carlos@0
   191
carlos@0
   192
  <SqlMethod name="selectBpgroup" type="preparedStatement" return="String" default="">
carlos@0
   193
    <SqlMethodComment></SqlMethodComment>
carlos@0
   194
    <Sql>
carlos@0
   195
    <![CDATA[
carlos@0
   196
      SELECT C_BP_GROUP.NAME
carlos@0
   197
      FROM C_BP_GROUP
carlos@423
   198
      WHERE C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)
carlos@0
   199
     ]]></Sql>
carlos@0
   200
    <Parameter name="cBpGroupId"/>
carlos@0
   201
  </SqlMethod>
carlos@0
   202
carlos@0
   203
  <SqlMethod name="selectProductCategory" type="preparedStatement" return="String" default="">
carlos@0
   204
    <SqlMethodComment></SqlMethodComment>
carlos@0
   205
    <Sql>
carlos@0
   206
    <![CDATA[
carlos@0
   207
      SELECT M_PRODUCT_CATEGORY.NAME
carlos@0
   208
      FROM M_PRODUCT_CATEGORY
carlos@423
   209
      WHERE M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)
carlos@0
   210
     ]]></Sql>
carlos@0
   211
    <Parameter name="mProductCategoryId"/>
carlos@0
   212
  </SqlMethod>
carlos@0
   213
carlos@0
   214
  <SqlMethod name="selectMwarehouse" type="preparedStatement" return="String" default="">
carlos@0
   215
    <SqlMethodComment></SqlMethodComment>
carlos@0
   216
    <Sql>
carlos@0
   217
    <![CDATA[
carlos@0
   218
      SELECT M_WAREHOUSE.NAME
carlos@0
   219
      FROM M_WAREHOUSE
carlos@423
   220
      WHERE M_WAREHOUSE.M_WAREHOUSE_ID = TO_NUMBER(?)
carlos@0
   221
     ]]></Sql>
carlos@0
   222
    <Parameter name="mWarehouseId"/>
carlos@0
   223
  </SqlMethod>
carlos@0
   224
carlos@0
   225
  <SqlMethod name="selectSalesrep" type="preparedStatement" return="String" default="">
carlos@0
   226
    <SqlMethodComment></SqlMethodComment>
carlos@0
   227
    <Sql>
carlos@0
   228
    <![CDATA[
carlos@0
   229
      SELECT AD_USER.FIRSTNAME||' '||AD_USER.LASTNAME
carlos@0
   230
      FROM AD_USER
carlos@423
   231
      WHERE AD_USER.AD_USER_ID = TO_NUMBER(?)
carlos@0
   232
     ]]></Sql>
carlos@0
   233
    <Parameter name="mWarehouseId"/>
carlos@0
   234
  </SqlMethod>
carlos@0
   235
carlos@0
   236
  <SqlMethod name="selectEntity" type="preparedStatement" return="String" default="">
carlos@0
   237
    <SqlMethodComment></SqlMethodComment>
carlos@0
   238
    <Sql>
carlos@0
   239
    <![CDATA[
carlos@0
   240
      SELECT AD_CLIENT.NAME
carlos@0
   241
      FROM AD_CLIENT
carlos@423
   242
      WHERE AD_CLIENT.AD_CLIENT_ID = TO_NUMBER(?)
carlos@0
   243
     ]]></Sql>
carlos@0
   244
    <Parameter name="adClientId"/>
carlos@0
   245
  </SqlMethod>
carlos@0
   246
carlos@0
   247
  <SqlMethod name="selectNotShown" type="preparedStatement" return="multiple">
carlos@0
   248
    <SqlMethodComment></SqlMethodComment>
carlos@0
   249
    <Sql>
carlos@0
   250
    <![CDATA[
carlos@0
   251
      SELECT ID, NAME
carlos@0
   252
      FROM (SELECT VALUE AS ID, NAME 
carlos@0
   253
              FROM AD_REF_LIST 
carlos@0
   254
             WHERE AD_REFERENCE_ID = 800087
carlos@0
   255
             AND AD_REF_LIST.VALUE IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')
carlos@573
   256
             ORDER BY TO_NUMBER(VALUE)) AA
carlos@0
   257
      WHERE 1=1 
carlos@0
   258
     ]]></Sql>
carlos@0
   259
     <Parameter name="notShown" optional="true" type="argument" after="WHERE 1=1 "><![CDATA[AND ID NOT IN]]></Parameter>
carlos@0
   260
  </SqlMethod>
carlos@0
   261
  <SqlMethod name="selectShown" type="preparedStatement" return="multiple">
carlos@0
   262
    <SqlMethodComment></SqlMethodComment>
carlos@0
   263
    <Sql>
carlos@0
   264
    <![CDATA[
carlos@0
   265
      SELECT ID, NAME
carlos@0
   266
      FROM (SELECT VALUE AS ID, NAME 
carlos@0
   267
              FROM AD_REF_LIST 
carlos@0
   268
             WHERE AD_REFERENCE_ID = 800087 
carlos@0
   269
             AND AD_REF_LIST.VALUE IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')
carlos@573
   270
             ORDER BY TO_NUMBER(VALUE)) AA
carlos@0
   271
      WHERE 1=1 
carlos@0
   272
     ]]></Sql>
carlos@0
   273
     <Parameter name="shown" optional="true" type="argument" after="WHERE 1=1 "><![CDATA[AND ID IN]]></Parameter>
carlos@0
   274
  </SqlMethod>
carlos@0
   275
carlos@0
   276
  <SqlMethod name="selectNotShownTrl" type="preparedStatement" return="multiple">
carlos@0
   277
    <SqlMethodComment></SqlMethodComment>
carlos@0
   278
    <Sql>
carlos@0
   279
    <![CDATA[
carlos@0
   280
      SELECT ID, NAME
carlos@0
   281
      FROM (SELECT VALUE AS ID, T.NAME 
carlos@0
   282
              FROM AD_REF_LIST_trl T,
carlos@0
   283
                   AD_REF_LIST     L
carlos@0
   284
             WHERE l.AD_REFERENCE_ID = 800087
carlos@0
   285
               AND l.AD_REF_LIST_ID  = t.AD_REF_LIST_ID
carlos@0
   286
               AND L.VALUE IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')
carlos@0
   287
               AND t.AD_LANGUAGE = ?
carlos@573
   288
             ORDER BY TO_NUMBER(VALUE)) AA
carlos@0
   289
      WHERE 1=1 
carlos@0
   290
     ]]></Sql>
carlos@0
   291
     <Parameter name="lang"/> 
carlos@0
   292
     <Parameter name="notShown" optional="true" type="argument" after="WHERE 1=1 "><![CDATA[AND ID NOT IN]]></Parameter>
carlos@0
   293
  </SqlMethod>
carlos@0
   294
  <SqlMethod name="selectShownTrl" type="preparedStatement" return="multiple">
carlos@0
   295
    <SqlMethodComment></SqlMethodComment>
carlos@0
   296
    <Sql>
carlos@0
   297
    <![CDATA[
carlos@0
   298
      SELECT ID, NAME
carlos@0
   299
      FROM (SELECT VALUE AS ID, T.NAME 
carlos@0
   300
              FROM AD_REF_LIST_trl T,
carlos@0
   301
                   AD_REF_LIST     L
carlos@0
   302
             WHERE l.AD_REFERENCE_ID = 800087
carlos@0
   303
               AND l.AD_REF_LIST_ID  = t.AD_REF_LIST_ID
carlos@0
   304
               AND L.VALUE IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')
carlos@0
   305
               AND t.AD_LANGUAGE = ?
carlos@573
   306
             ORDER BY TO_NUMBER(VALUE)) AA
carlos@0
   307
      WHERE 1=1 
carlos@0
   308
     ]]></Sql>
carlos@0
   309
     <Parameter name="lang"/> 
carlos@0
   310
     <Parameter name="shown" optional="true" type="argument" after="WHERE 1=1 "><![CDATA[AND ID IN]]></Parameter>
carlos@0
   311
  </SqlMethod>
carlos@0
   312
</SqlClass>