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