src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalyses_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
carlos@0
    22
carlos@0
    23
carlos@0
    24
carlos@0
    25
<SqlClass name="ReportRefundSalesDimensionalAnalysesData" package="org.openbravo.erpCommon.ad_reports">
carlos@0
    26
  <SqlClassComment></SqlClassComment>
carlos@0
    27
  <SqlMethod name="select" type="preparedStatement" return="multiple">
carlos@0
    28
    <SqlMethodComment></SqlMethodComment>
carlos@0
    29
    <Sql>
carlos@0
    30
    <![CDATA[
carlos@0
    31
      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, SUM(LINENETAMT) AS LINENETAMT, SUM(REFUNDAMT) AS REFUNDAMT, SUM(QTYINVOICED) AS QTYINVOICED, SUM(REFUNDQTY) AS REFUNDQTY, SUM(LINENETREF) AS LINENETREF, SUM(REFUNDAMTREF) AS REFUNDAMTREF, DIVIDE(SUM(REFUNDAMT), (SUM(LINENETAMT)+SUM(REFUNDAMT)))*100 AS RATIO, SUM(QTYINVOICEDREF) AS QTYINVOICEDREF, SUM(REFUNDQTYREF) AS REFUNDQTYREF, '' AS ID, '' AS NAME, UOMSYMBOL
carlos@0
    32
      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,
carlos@0
    33
      CASE SIGN(C_ORDERLINE.LINENETAMT) WHEN  -1 THEN  0 ELSE  C_ORDERLINE.LINENETAMT END AS LINENETAMT, CASE SIGN(C_ORDERLINE.LINENETAMT) WHEN  -1 THEN  -1*C_ORDERLINE.LINENETAMT ELSE  0 END AS REFUNDAMT, CASE SIGN(C_ORDERLINE.QTYORDERED) WHEN  -1 THEN  0 ELSE  C_ORDERLINE.QTYORDERED END AS QTYINVOICED, CASE SIGN(C_ORDERLINE.QTYORDERED) WHEN  -1 THEN  (-1*C_ORDERLINE.QTYORDERED) ELSE  0 END AS REFUNDQTY, 0 AS LINENETREF, 0 AS REFUNDAMTREF, 0 AS QTYINVOICEDREF, 0 AS REFUNDQTYREF, C_UOM.UOMSYMBOL
carlos@0
    34
      FROM C_ORDER left join AD_USER on C_ORDER.SALESREP_ID = AD_USER.AD_USER_ID,
carlos@0
    35
           C_ORDERLINE left join M_PRODUCT on C_ORDERLINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
carlos@0
    36
                       left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
carlos@0
    37
                       left join C_UOM on C_ORDERLINE.C_UOM_ID = C_UOM.C_UOM_ID,
carlos@0
    38
         C_BPARTNER, C_BP_GROUP, M_WAREHOUSE
carlos@0
    39
      WHERE C_ORDER.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
carlos@0
    40
      AND C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
carlos@0
    41
      AND C_ORDER.C_ORDER_ID = C_ORDERLINE.C_ORDER_ID
carlos@0
    42
      AND C_ORDER.M_WAREHOUSE_ID = M_WAREHOUSE.M_WAREHOUSE_ID
carlos@0
    43
      AND C_ORDER.ISSOTRX = 'Y'
carlos@0
    44
      AND C_ORDER.PROCESSED = 'Y'
carlos@0
    45
      AND 0=0 AND C_ORDER.AD_ORG_ID IN ('1')
carlos@0
    46
      AND C_ORDER.AD_CLIENT_ID IN ('8')
carlos@0
    47
      AND 1=1
carlos@0
    48
      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 ,
carlos@0
    49
      0 AS LINENETAMT, 0 AS REFUNDAMT, 0 AS QTYINVOICED, 0 AS REFUNDQTY, CASE SIGN(C_ORDERLINE.LINENETAMT) WHEN  -1 THEN  0 ELSE  C_ORDERLINE.LINENETAMT END AS LINENETREF, CASE SIGN(C_ORDERLINE.LINENETAMT) WHEN  -1 THEN  (-1*C_ORDERLINE.LINENETAMT) ELSE  0 END AS REFUNDAMTREF, CASE SIGN(C_ORDERLINE.QTYORDERED) WHEN  -1 THEN  0 ELSE  C_ORDERLINE.QTYORDERED END AS QTYINVOICEDREF, CASE SIGN(C_ORDERLINE.QTYORDERED) WHEN  -1 THEN  (-1*C_ORDERLINE.QTYORDERED) ELSE  0 END AS REFUNDQTYREF, C_UOM.UOMSYMBOL
carlos@0
    50
      FROM C_ORDER left join AD_USER on C_ORDER.SALESREP_ID = AD_USER.AD_USER_ID,
carlos@0
    51
           C_ORDERLINE left join M_PRODUCT on C_ORDERLINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID 
carlos@0
    52
                       left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
carlos@0
    53
                       left join C_UOM on C_ORDERLINE.C_UOM_ID = C_UOM.C_UOM_ID,
carlos@0
    54
           C_BPARTNER, C_BP_GROUP, M_WAREHOUSE
carlos@0
    55
      WHERE C_ORDER.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
carlos@0
    56
      AND C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
carlos@0
    57
      AND C_ORDER.C_ORDER_ID = C_ORDERLINE.C_ORDER_ID
carlos@0
    58
      AND C_ORDER.M_WAREHOUSE_ID = M_WAREHOUSE.M_WAREHOUSE_ID
carlos@0
    59
      AND C_ORDER.ISSOTRX = 'Y'
carlos@0
    60
      AND C_ORDER.PROCESSED = 'Y'
carlos@0
    61
      AND 3=3 AND C_ORDER.AD_ORG_ID IN ('1')
carlos@0
    62
      AND C_ORDER.AD_CLIENT_ID IN('16')
carlos@0
    63
      AND 2=2) AA
carlos@0
    64
      WHERE LINENETAMT <> 0
carlos@0
    65
      OR REFUNDAMT <> 0
carlos@0
    66
      OR LINENETREF <> 0
carlos@0
    67
      OR REFUNDAMTREF <> 0
carlos@0
    68
      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, UOMSYMBOL, 1
carlos@0
    69
     ]]></Sql>
carlos@0
    70
    <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
carlos@0
    71
    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
carlos@0
    72
    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
carlos@0
    73
    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3, to_char(" text="'4'"/>
carlos@0
    74
    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4, to_char(" text="'5'"/>
carlos@0
    75
    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5, to_char(" text="'6'"/>
carlos@0
    76
    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6, to_char(" text="'7'"/>
carlos@0
    77
    <Parameter name="adOrgId" optional="true" type="replace" after="AND 0=0 AND C_ORDER.AD_ORG_ID IN (" text="'1'"/>
carlos@0
    78
    <Parameter name="adUserClient" type="replace" optional="true" after="AND C_ORDER.AD_CLIENT_ID IN (" text="'8'"/>
carlos@0
    79
    <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND C_ORDER.DATEORDERED >= to_date(?)]]></Parameter>
carlos@0
    80
    <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND C_ORDER.DATEORDERED < 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="cBpartner" optional="true" type="argument" after="AND 1=1" text=" AND C_BPARTNER.C_BPARTNER_ID IN"/>
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="mProduct" optional="true" type="argument" after="AND 1=1"><![CDATA[ AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
carlos@423
    85
    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND C_ORDER.SALESREP_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
    86
    <Parameter name="mWarehouseId" optional="true" after="AND 1=1"><![CDATA[AND M_WAREHOUSE.M_WAREHOUSE_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
    87
    <Parameter name="nivel1" type="replace" optional="true" after="UNION ALL SELECT to_char(" text="'9'"/>
carlos@0
    88
    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1 , to_char(" text="'10'"/>
carlos@0
    89
    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2 , to_char(" text="'11'"/>
carlos@0
    90
    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3 , to_char(" text="'12'"/>
carlos@0
    91
    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4 , to_char(" text="'13'"/>
carlos@0
    92
    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5 , to_char(" text="'14'"/>
carlos@0
    93
    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6 , to_char(" text="'15'"/>
carlos@0
    94
    <Parameter name="adOrgId" optional="true" type="replace" after="AND 3=3 AND C_ORDER.AD_ORG_ID IN (" text="'1'"/>
carlos@0
    95
    <Parameter name="adUserClient" type="replace" optional="true" after="AND C_ORDER.AD_CLIENT_ID IN(" text="'16'"/>
carlos@0
    96
    <Parameter name="dateFromRef" optional="true" after="AND 2=2"><![CDATA[AND C_ORDER.DATEORDERED >= to_date(?)]]></Parameter>
carlos@0
    97
    <Parameter name="dateToRef" optional="true" after="AND 2=2"><![CDATA[AND C_ORDER.DATEORDERED < to_date(?)]]></Parameter>
carlos@423
    98
    <Parameter name="cBpartnerGroupId" optional="true" after="AND 2=2"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
    99
    <Parameter name="cBpartner" optional="true" type="argument" after="AND 2=2" text=" AND C_BPARTNER.C_BPARTNER_ID IN"/>
carlos@423
   100
    <Parameter name="mProductCategoryId" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   101
    <Parameter name="mProduct" optional="true" type="argument" after="AND 2=2"><![CDATA[ AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
carlos@423
   102
    <Parameter name="salesrepId" optional="true" after="AND 2=2"><![CDATA[AND C_ORDER.SALESREP_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
   103
    <Parameter name="mWarehouseId" optional="true" after="AND 2=2"><![CDATA[AND M_WAREHOUSE.M_WAREHOUSE_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   104
    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, UOMSYMBOL" text=", 1"/>
carlos@0
   105
  </SqlMethod>
carlos@0
   106
  <SqlMethod name="set" type="constant" return="multiple">
carlos@0
   107
      <SqlMethodComment></SqlMethodComment>
carlos@0
   108
      <Sql></Sql>
carlos@0
   109
  </SqlMethod>
carlos@0
   110
  <SqlMethod name="selectNoComparative" type="preparedStatement" return="multiple">
carlos@0
   111
    <SqlMethodComment></SqlMethodComment>
carlos@0
   112
    <Sql>
carlos@0
   113
    <![CDATA[
carlos@0
   114
      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, SUM(LINENETAMT) AS LINENETAMT, SUM(REFUNDAMT) AS REFUNDAMT, DIVIDE(SUM(REFUNDAMT), (SUM(LINENETAMT)+SUM(REFUNDAMT)))*100 AS RATIO, SUM(QTYINVOICED) AS QTYINVOICED, SUM(REFUNDQTY) AS REFUNDQTY, SUM(LINENETREF) AS LINENETREF, SUM(REFUNDAMTREF) AS REFUNDAMTREF, SUM(QTYINVOICEDREF) AS QTYINVOICEDREF, SUM(REFUNDQTYREF) AS REFUNDQTYREF, '' AS ID, '' AS NAME, UOMSYMBOL
carlos@0
   115
      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,
carlos@0
   116
      CASE SIGN(C_ORDERLINE.LINENETAMT) WHEN  -1 THEN  0 ELSE  C_ORDERLINE.LINENETAMT END AS LINENETAMT, CASE SIGN(C_ORDERLINE.LINENETAMT) WHEN  -1 THEN  -1*C_ORDERLINE.LINENETAMT ELSE  0 END AS REFUNDAMT, CASE SIGN(C_ORDERLINE.QTYORDERED) WHEN  -1 THEN  0 ELSE  C_ORDERLINE.QTYORDERED END AS QTYINVOICED, CASE SIGN(C_ORDERLINE.QTYORDERED) WHEN  -1 THEN  (-1*C_ORDERLINE.QTYORDERED) ELSE  0 END AS REFUNDQTY, 0 AS LINENETREF, 0 AS REFUNDAMTREF, 0 AS QTYINVOICEDREF, 0 AS REFUNDQTYREF, C_UOM.UOMSYMBOL
carlos@0
   117
      FROM C_ORDER left join AD_USER on C_ORDER.SALESREP_ID = AD_USER.AD_USER_ID,
carlos@0
   118
           C_ORDERLINE left join M_PRODUCT on C_ORDERLINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
carlos@0
   119
                       left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
carlos@0
   120
                       left join C_UOM on C_ORDERLINE.C_UOM_ID = C_UOM.C_UOM_ID,
carlos@0
   121
       C_BPARTNER, C_BP_GROUP, M_WAREHOUSE
carlos@0
   122
      WHERE C_ORDER.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
carlos@0
   123
      AND C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
carlos@0
   124
      AND C_ORDER.C_ORDER_ID = C_ORDERLINE.C_ORDER_ID
carlos@0
   125
      AND C_ORDER.M_WAREHOUSE_ID = M_WAREHOUSE.M_WAREHOUSE_ID
carlos@0
   126
      AND C_ORDER.ISSOTRX = 'Y'
carlos@0
   127
      AND C_ORDER.PROCESSED = 'Y'
carlos@0
   128
      AND 0=0 AND C_ORDER.AD_ORG_ID IN ('1')
carlos@0
   129
      AND C_ORDER.AD_CLIENT_ID IN ('8')
carlos@0
   130
      AND 1=1) AA
carlos@0
   131
      WHERE LINENETAMT <> 0
carlos@0
   132
      OR REFUNDAMT <> 0
carlos@0
   133
      OR LINENETREF <> 0
carlos@0
   134
      OR REFUNDAMTREF <> 0
carlos@0
   135
      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, UOMSYMBOL, 1
carlos@0
   136
     ]]></Sql>
carlos@0
   137
    <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
carlos@0
   138
    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
carlos@0
   139
    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
carlos@0
   140
    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3, to_char(" text="'4'"/>
carlos@0
   141
    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4, to_char(" text="'5'"/>
carlos@0
   142
    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5, to_char(" text="'6'"/>
carlos@0
   143
    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6, to_char(" text="'7'"/>
carlos@0
   144
    <Parameter name="adOrgId" optional="true" type="replace" after="AND 0=0 AND C_ORDER.AD_ORG_ID IN (" text="'1'"/>
carlos@0
   145
    <Parameter name="adUserClient" type="replace" optional="true" after="AND C_ORDER.AD_CLIENT_ID IN (" text="'8'"/>
carlos@0
   146
    <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND C_ORDER.DATEORDERED >= to_date(?)]]></Parameter>
carlos@0
   147
    <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND C_ORDER.DATEORDERED < to_date(?)]]></Parameter>
carlos@423
   148
    <Parameter name="cBpartnerGroupId" optional="true" after="AND 1=1"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   149
    <Parameter name="cBpartner" optional="true" type="argument" after="AND 1=1" text=" AND C_BPARTNER.C_BPARTNER_ID IN"/>
carlos@423
   150
    <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   151
    <Parameter name="mProduct" optional="true" type="argument" after="AND 1=1"><![CDATA[ AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
carlos@423
   152
    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND C_ORDER.SALESREP_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
   153
    <Parameter name="mWarehouseId" optional="true" after="AND 1=1"><![CDATA[AND M_WAREHOUSE.M_WAREHOUSE_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
   154
    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, UOMSYMBOL" text=", 1"/>
carlos@0
   155
  </SqlMethod>
carlos@0
   156
  <SqlMethod name="selectBpartner" type="preparedStatement" return="multiple">
carlos@0
   157
    <SqlMethodComment></SqlMethodComment>
carlos@0
   158
    <Sql>
carlos@0
   159
    <![CDATA[
carlos@0
   160
      SELECT C_BPARTNER_ID AS ID, C_BPARTNER.NAME
carlos@0
   161
      FROM C_BPARTNER
carlos@0
   162
      WHERE AD_ORG_ID IN ('1') 
carlos@0
   163
      AND AD_CLIENT_ID IN ('1') 
carlos@0
   164
      AND (1=2 )
carlos@0
   165
     ]]></Sql>
carlos@0
   166
     <Parameter name="adOrgClient" type="replace" optional="true" after="AD_ORG_ID IN (" text="'1'"/>
carlos@0
   167
     <Parameter name="adUserClient" type="replace" optional="true" after="AND AD_CLIENT_ID IN (" text="'1'"/>
carlos@0
   168
     <Parameter name="cBpartnerId" optional="true" type="argument" after="(1=2" text=" OR C_BPARTNER_ID IN"/>
carlos@0
   169
  </SqlMethod>
carlos@0
   170
carlos@0
   171
  <SqlMethod name="selectMproduct" type="preparedStatement" return="multiple">
carlos@0
   172
    <SqlMethodComment></SqlMethodComment>
carlos@0
   173
    <Sql>
carlos@0
   174
    <![CDATA[
carlos@0
   175
      SELECT M_PRODUCT.M_PRODUCT_ID AS ID,M_PRODUCT.NAME
carlos@0
   176
      FROM M_PRODUCT
carlos@0
   177
      WHERE AD_ORG_ID IN ('1') 
carlos@0
   178
      AND AD_CLIENT_ID IN ('1') 
carlos@0
   179
      AND (1=2 )
carlos@0
   180
     ]]></Sql>
carlos@0
   181
     <Parameter name="adOrgClient" type="replace" optional="true" after="AD_ORG_ID IN (" text="'1'"/>
carlos@0
   182
     <Parameter name="adUserClient" type="replace" optional="true" after="AND AD_CLIENT_ID IN (" text="'1'"/>
carlos@0
   183
     <Parameter name="mProductId" optional="true" type="argument" after="(1=2" text=" OR M_PRODUCT_ID IN"/>
carlos@0
   184
  </SqlMethod>
carlos@0
   185
carlos@0
   186
  <SqlMethod name="selectBpgroup" type="preparedStatement" return="String" default="">
carlos@0
   187
    <SqlMethodComment></SqlMethodComment>
carlos@0
   188
    <Sql>
carlos@0
   189
    <![CDATA[
carlos@0
   190
      SELECT C_BP_GROUP.NAME
carlos@0
   191
      FROM C_BP_GROUP
carlos@423
   192
      WHERE C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)
carlos@0
   193
     ]]></Sql>
carlos@0
   194
    <Parameter name="cBpGroupId"/>
carlos@0
   195
  </SqlMethod>
carlos@0
   196
carlos@0
   197
  <SqlMethod name="selectProductCategory" type="preparedStatement" return="String" default="">
carlos@0
   198
    <SqlMethodComment></SqlMethodComment>
carlos@0
   199
    <Sql>
carlos@0
   200
    <![CDATA[
carlos@0
   201
      SELECT M_PRODUCT_CATEGORY.NAME
carlos@0
   202
      FROM M_PRODUCT_CATEGORY
carlos@423
   203
      WHERE M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)
carlos@0
   204
     ]]></Sql>
carlos@0
   205
    <Parameter name="mProductCategoryId"/>
carlos@0
   206
  </SqlMethod>
carlos@0
   207
carlos@0
   208
  <SqlMethod name="selectSalesrep" type="preparedStatement" return="String" default="">
carlos@0
   209
    <SqlMethodComment></SqlMethodComment>
carlos@0
   210
    <Sql>
carlos@0
   211
    <![CDATA[
carlos@0
   212
      SELECT AD_USER.FIRSTNAME||' '||AD_USER.LASTNAME
carlos@0
   213
      FROM AD_USER
carlos@423
   214
      WHERE AD_USER.AD_USER_ID = TO_NUMBER(?)
carlos@0
   215
     ]]></Sql>
carlos@0
   216
    <Parameter name="salesrepId"/>
carlos@0
   217
  </SqlMethod>
carlos@0
   218
carlos@0
   219
  <SqlMethod name="selectMwarehouse" type="preparedStatement" return="String" default="">
carlos@0
   220
    <SqlMethodComment></SqlMethodComment>
carlos@0
   221
    <Sql>
carlos@0
   222
    <![CDATA[
carlos@0
   223
      SELECT M_WAREHOUSE.NAME
carlos@0
   224
      FROM M_WAREHOUSE
carlos@423
   225
      WHERE M_WAREHOUSE.M_WAREHOUSE_ID = TO_NUMBER(?)
carlos@0
   226
     ]]></Sql>
carlos@0
   227
    <Parameter name="mWarehouseId"/>
carlos@0
   228
  </SqlMethod>
carlos@0
   229
carlos@0
   230
  <SqlMethod name="selectNotShown" type="preparedStatement" return="multiple">
carlos@0
   231
    <SqlMethodComment></SqlMethodComment>
carlos@0
   232
    <Sql>
carlos@0
   233
    <![CDATA[
carlos@0
   234
      SELECT ID, NAME
carlos@0
   235
      FROM (SELECT VALUE AS ID, NAME 
carlos@0
   236
              FROM AD_REF_LIST 
carlos@0
   237
             WHERE AD_REFERENCE_ID = 800087
carlos@0
   238
             AND AD_REF_LIST.VALUE IN ('1', '2', '3', '4', '5', '6', '7')
carlos@573
   239
             ORDER BY TO_NUMBER(VALUE)) AA
carlos@0
   240
      WHERE 1=1 
carlos@0
   241
     ]]></Sql>
carlos@0
   242
     <Parameter name="notShown" optional="true" type="argument" after="WHERE 1=1 "><![CDATA[AND ID NOT IN]]></Parameter>
carlos@0
   243
  </SqlMethod>
carlos@0
   244
  <SqlMethod name="selectShown" type="preparedStatement" return="multiple">
carlos@0
   245
    <SqlMethodComment></SqlMethodComment>
carlos@0
   246
    <Sql>
carlos@0
   247
    <![CDATA[
carlos@0
   248
      SELECT ID, NAME
carlos@0
   249
      FROM (SELECT VALUE AS ID, NAME 
carlos@0
   250
              FROM AD_REF_LIST 
carlos@0
   251
             WHERE AD_REFERENCE_ID = 800087 
carlos@0
   252
             AND AD_REF_LIST.VALUE IN ('1', '2', '3', '4', '5', '6', '7')
carlos@573
   253
             ORDER BY TO_NUMBER(VALUE)) AA
carlos@0
   254
      WHERE 1=1 
carlos@0
   255
     ]]></Sql>
carlos@0
   256
     <Parameter name="shown" optional="true" type="argument" after="WHERE 1=1 "><![CDATA[AND ID IN]]></Parameter>
carlos@0
   257
  </SqlMethod>
carlos@0
   258
carlos@0
   259
  <SqlMethod name="selectNotShownTrl" type="preparedStatement" return="multiple">
carlos@0
   260
    <SqlMethodComment></SqlMethodComment>
carlos@0
   261
    <Sql>
carlos@0
   262
    <![CDATA[
carlos@0
   263
      SELECT ID, NAME
carlos@0
   264
      FROM (SELECT VALUE AS ID, T.NAME 
carlos@0
   265
              FROM AD_REF_LIST_trl T,
carlos@0
   266
                   AD_REF_LIST     L
carlos@0
   267
             WHERE l.AD_REFERENCE_ID = 800087
carlos@0
   268
               AND l.AD_REF_LIST_ID  = t.AD_REF_LIST_ID
carlos@0
   269
               AND L.VALUE IN ('1', '2', '3', '4', '5', '6', '7')
carlos@0
   270
               AND t.AD_LANGUAGE = ?
carlos@573
   271
             ORDER BY TO_NUMBER(VALUE)) AA
carlos@0
   272
      WHERE 1=1 
carlos@0
   273
     ]]></Sql>
carlos@0
   274
     <Parameter name="lang"/> 
carlos@0
   275
     <Parameter name="notShown" optional="true" type="argument" after="WHERE 1=1 "><![CDATA[AND ID NOT IN]]></Parameter>
carlos@0
   276
  </SqlMethod>
carlos@0
   277
  <SqlMethod name="selectShownTrl" type="preparedStatement" return="multiple">
carlos@0
   278
    <SqlMethodComment></SqlMethodComment>
carlos@0
   279
    <Sql>
carlos@0
   280
    <![CDATA[
carlos@0
   281
      SELECT ID, NAME
carlos@0
   282
      FROM (SELECT VALUE AS ID, T.NAME 
carlos@0
   283
              FROM AD_REF_LIST_trl T,
carlos@0
   284
                   AD_REF_LIST     L
carlos@0
   285
             WHERE l.AD_REFERENCE_ID = 800087
carlos@0
   286
               AND l.AD_REF_LIST_ID  = t.AD_REF_LIST_ID
carlos@0
   287
               AND L.VALUE IN ('1', '2', '3', '4', '5', '6', '7')
carlos@0
   288
               AND t.AD_LANGUAGE = ?
carlos@573
   289
             ORDER BY TO_NUMBER(VALUE)) AA
carlos@0
   290
      WHERE 1=1 
carlos@0
   291
     ]]></Sql>
carlos@0
   292
     <Parameter name="lang"/> 
carlos@0
   293
     <Parameter name="shown" optional="true" type="argument" after="WHERE 1=1 "><![CDATA[AND ID IN]]></Parameter>
carlos@0
   294
  </SqlMethod>
carlos@0
   295
</SqlClass>