src/org/openbravo/erpCommon/ad_reports/MInOutTraceReports_data.xsql
author David Baz Fayos <david.baz@openbravo.com>
Tue, 27 May 2008 15:26:10 +0000
changeset 1044 8691bbc94032
parent 683 8cc2b7ffa4f4
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="MInOutTraceReportsData" 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 DISTINCT t.M_PRODUCT_ID, AD_COLUMN_IDENTIFIER(TO_CHAR('M_Product'), TO_CHAR(T.M_PRODUCT_ID), TO_CHAR('es_ES')) AS product_name, 
carlos@0
    32
          t.M_ATTRIBUTESETINSTANCE_ID, AD_COLUMN_IDENTIFIER(TO_CHAR('M_AttributeSetInstance'), TO_CHAR(T.M_ATTRIBUTESETINSTANCE_ID), TO_CHAR('es_ES')) AS attribute_name, 
carlos@0
    33
          t.M_LOCATOR_ID, AD_COLUMN_IDENTIFIER(TO_CHAR('M_LOCATOR'), TO_CHAR(T.M_LOCATOR_ID), TO_CHAR('es_ES')) as locator_name,
carlos@0
    34
          '' AS html, ''  AS ID, '' AS MOVEMENTTYPE, '' AS MOVEMENTDATE, '' AS MOVEMENTQTY, '' AS M_INVENTORYLINE_ID, '' AS M_MOVEMENTLINE_ID,
carlos@0
    35
          '' AS M_INOUTLINE_ID, '' AS M_PRODUCTIONLINE_ID, '' AS C_PROJECTISSUE_ID, '' AS M_PRODUCT_UOM_ID, '' AS QUANTITYORDER, '' AS C_UOM_ID,
carlos@0
    36
          '' AS MOVEMENTTYPE_NAME, '' AS PRODUCT_UOM_NAME, '' AS UOM_NAME, '' AS VENDOR_NAME, '' AS NAME, '' AS INVENTORY_NAME, '' AS MOVEMENT_NAME,
carlos@0
    37
          '' AS INOUT_NAME, '' AS PRODUCTION_NAME
carlos@0
    38
      FROM M_TRANSACTION t
carlos@0
    39
      WHERE 1=1
asier@683
    40
      AND t.AD_ORG_ID IN ('1')
asier@683
    41
      AND t.AD_CLIENT_ID IN ('1')
carlos@0
    42
      AND t.M_ATTRIBUTESETINSTANCE_ID <> 0
carlos@0
    43
      GROUP BY t.M_PRODUCT_ID, t.M_ATTRIBUTESETINSTANCE_ID, t.M_LOCATOR_ID
carlos@0
    44
    ]]></Sql>
carlos@423
    45
    <Parameter name="parmProductId" optional="true" after="WHERE 1=1"><![CDATA[AND T.M_PRODUCT_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
    46
    <Parameter name="parmAttributeSetInstanceId" optional="true" after="WHERE 1=1"><![CDATA[AND T.M_ATTRIBUTESETINSTANCE_ID = TO_NUMBER(?)]]></Parameter>
asier@683
    47
    <Parameter name="adUserOrg" type="replace" optional="true" after="AND t.AD_ORG_ID IN (" text="'1'"/>
asier@683
    48
    <Parameter name="adUserClient" type="replace" optional="true" after="AND t.AD_CLIENT_ID IN (" text="'1'"/>
carlos@0
    49
  </SqlMethod>
carlos@0
    50
carlos@0
    51
  <SqlMethod name="set" type="constant" return="multiple">
carlos@0
    52
      <SqlMethodComment></SqlMethodComment>
carlos@0
    53
      <Sql></Sql>
carlos@0
    54
  </SqlMethod>
carlos@0
    55
carlos@0
    56
  <SqlMethod name="selectChilds" type="preparedStatement" return="multiple">
carlos@0
    57
    <SqlMethodComment></SqlMethodComment>
carlos@0
    58
    <Sql>
carlos@0
    59
    <![CDATA[
carlos@0
    60
      SELECT T.M_TRANSACTION_ID AS ID, T.MOVEMENTTYPE, T.M_LOCATOR_ID, T.M_PRODUCT_ID, T.MOVEMENTDATE, 
carlos@0
    61
          ROUND(T.MOVEMENTQTY,4) AS MOVEMENTQTY, T.M_INVENTORYLINE_ID, T.M_MOVEMENTLINE_ID, T.M_INOUTLINE_ID, T.M_PRODUCTIONLINE_ID, 
carlos@0
    62
          T.C_PROJECTISSUE_ID, T.M_ATTRIBUTESETINSTANCE_ID, T.M_PRODUCT_UOM_ID, ROUND(T.QUANTITYORDER,4) AS QUANTITYORDER, T.C_UOM_ID, 
carlos@0
    63
          L.NAME AS MOVEMENTTYPE_NAME, 
carlos@0
    64
          (CASE WHEN T.M_PRODUCT_UOM_ID IS NOT NULL THEN TO_CHAR(C2.UOMSYMBOL) END) AS PRODUCT_UOM_NAME, 
carlos@0
    65
          C1.UOMSYMBOL AS UOM_NAME, 
carlos@0
    66
          AD_COLUMN_IDENTIFIER(TO_CHAR('M_Product'), TO_CHAR(T.M_PRODUCT_ID), TO_CHAR(?)) AS PRODUCT_NAME,
carlos@0
    67
          AD_COLUMN_IDENTIFIER(TO_CHAR('M_AttributeSetInstance'), TO_CHAR(T.M_ATTRIBUTESETINSTANCE_ID), TO_CHAR(?)) AS ATTRIBUTE_NAME,
carlos@0
    68
          (SELECT NAME FROM C_BPARTNER WHERE C_BPARTNER_ID = M.C_BPARTNER_ID) || ' - ' || M.DOCUMENTNO AS VENDOR_NAME, 
carlos@0
    69
          AD_COLUMN_IDENTIFIER(TO_CHAR('M_LOCATOR'), TO_CHAR(T.M_LOCATOR_ID), TO_CHAR(?)) AS LOCATOR_NAME, '' AS NAME, 
carlos@0
    70
          AD_COLUMN_IDENTIFIER(TO_CHAR('M_InventoryLine'), TO_CHAR(T.M_INVENTORYLINE_ID), TO_CHAR(?)) AS INVENTORY_NAME, 
carlos@0
    71
          AD_COLUMN_IDENTIFIER(TO_CHAR('M_MovementLine'), TO_CHAR(T.M_MOVEMENTLINE_ID), TO_CHAR(?)) AS MOVEMENT_NAME, 
carlos@0
    72
          AD_COLUMN_IDENTIFIER(TO_CHAR('M_InoutLine'), TO_CHAR(T.M_INOUTLINE_ID), TO_CHAR(?)) AS INOUT_NAME, 
carlos@0
    73
          AD_COLUMN_IDENTIFIER(TO_CHAR('M_ProductionLine'), TO_CHAR(T.M_PRODUCTIONLINE_ID), TO_CHAR(?)) AS PRODUCTION_NAME
carlos@0
    74
      FROM  M_TRANSACTION T  LEFT OUTER JOIN  M_INOUTLINE ML  ON  T.M_INOUTLINE_ID  = ML.M_INOUTLINE_ID   
carlos@0
    75
		       LEFT OUTER JOIN  M_INOUT M  ON  ML.M_INOUT_ID  = M.M_INOUT_ID   
carlos@0
    76
            	       LEFT OUTER JOIN  M_PRODUCT_UOM M_P  ON  T.M_PRODUCT_UOM_ID  = M_P.M_PRODUCT_UOM_ID   
carlos@0
    77
                       LEFT OUTER JOIN  C_UOM C2  ON  M_P.C_UOM_ID  = C2.C_UOM_ID ,
carlos@0
    78
       AD_REF_LIST_V L,
carlos@0
    79
       C_UOM C1 
carlos@0
    80
    WHERE	 T.MOVEMENTTYPE  = L.VALUE
carlos@0
    81
     AND	L.AD_REFERENCE_ID  = 189
carlos@0
    82
     AND	L.AD_LANGUAGE  = ?
carlos@0
    83
     AND	T.C_UOM_ID  = C1.C_UOM_ID
carlos@423
    84
     AND	T.M_ATTRIBUTESETINSTANCE_ID = TO_NUMBER(?)
carlos@423
    85
     AND	T.M_PRODUCT_ID = TO_NUMBER(?)
carlos@423
    86
     AND	T.M_LOCATOR_ID = TO_NUMBER(?)
carlos@0
    87
     AND	1  = 1
carlos@0
    88
    ORDER BY T.MOVEMENTDATE,
carlos@0
    89
       T.CREATED 
carlos@0
    90
     ]]></Sql>
carlos@0
    91
     <Parameter name="adLanguage"/>
carlos@0
    92
     <Parameter name="adLanguage"/>
carlos@0
    93
     <Parameter name="adLanguage"/>
carlos@0
    94
     <Parameter name="adLanguage"/>
carlos@0
    95
     <Parameter name="adLanguage"/>
carlos@0
    96
     <Parameter name="adLanguage"/>
carlos@0
    97
     <Parameter name="adLanguage"/>
carlos@0
    98
     <Parameter name="adLanguage"/>
carlos@0
    99
     <Parameter name="mAttributesetinstanceId"/>
carlos@0
   100
     <Parameter name="mProductId"/>
carlos@0
   101
     <Parameter name="mLocatorId"/>
carlos@0
   102
     <Parameter name="plusQty" optional="true" type="none" after="AND 1=1"><![CDATA[ AND (T.MOVEMENTTYPE <> 'P+' OR  T.MOVEMENTQTY < 0) ]]></Parameter>
carlos@0
   103
     <Parameter name="minusQty" optional="true" type="none" after="AND 1=1"><![CDATA[ AND (T.MOVEMENTTYPE <> 'P+' OR  T.MOVEMENTQTY > 0) ]]></Parameter>
carlos@0
   104
  </SqlMethod>
carlos@0
   105
  <SqlMethod name="selectProductionOut" type="preparedStatement" return="multiple">
carlos@0
   106
    <SqlMethodComment></SqlMethodComment>
carlos@0
   107
    <Sql>
carlos@0
   108
    <![CDATA[
carlos@0
   109
      SELECT T.M_TRANSACTION_ID AS ID, T.MOVEMENTTYPE, T.M_LOCATOR_ID, T.M_PRODUCT_ID, T.MOVEMENTDATE, 
carlos@0
   110
      ROUND(T.MOVEMENTQTY,4) AS MOVEMENTQTY, T.M_INVENTORYLINE_ID, T.M_MOVEMENTLINE_ID, T.M_INOUTLINE_ID, T.M_PRODUCTIONLINE_ID, 
carlos@0
   111
      T.C_PROJECTISSUE_ID, T.M_ATTRIBUTESETINSTANCE_ID, T.M_PRODUCT_UOM_ID, ROUND(T.QUANTITYORDER,4) AS QUANTITYORDER, T.C_UOM_ID, 
carlos@0
   112
      L.NAME AS MOVEMENTTYPE_NAME, 
carlos@0
   113
      (CASE WHEN T.M_PRODUCT_UOM_ID IS NOT NULL THEN TO_CHAR(C2.UOMSYMBOL) END) AS PRODUCT_UOM_NAME, 
carlos@0
   114
      C1.UOMSYMBOL AS UOM_NAME, 
carlos@0
   115
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_Product'), TO_CHAR(T.M_PRODUCT_ID), TO_CHAR(?)) AS PRODUCT_NAME, 
carlos@0
   116
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_LOCATOR'), TO_CHAR(T.M_LOCATOR_ID), TO_CHAR(?)) AS LOCATOR_NAME, '' AS NAME, 
carlos@0
   117
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_InventoryLine'), TO_CHAR(T.M_INVENTORYLINE_ID), TO_CHAR(?)) AS INVENTORY_NAME, 
carlos@0
   118
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_MovementLine'), TO_CHAR(T.M_MOVEMENTLINE_ID), TO_CHAR(?)) AS MOVEMENT_NAME, 
carlos@0
   119
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_InoutLine'), TO_CHAR(T.M_INOUTLINE_ID), TO_CHAR(?)) AS INOUT_NAME, 
carlos@0
   120
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_AttributeSetInstance'), TO_CHAR(T.M_ATTRIBUTESETINSTANCE_ID), TO_CHAR(?)) AS ATTRIBUTE_NAME,
carlos@0
   121
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_ProductionLine'), TO_CHAR(T.M_PRODUCTIONLINE_ID), TO_CHAR(?)) AS PRODUCTION_NAME
carlos@0
   122
      FROM M_PRODUCT_UOM M_P left join C_UOM C2 on M_P.C_UOM_ID = C2.C_UOM_ID
carlos@0
   123
                             right join M_TRANSACTION T on M_P.M_PRODUCT_UOM_ID = T.M_PRODUCT_UOM_ID,
carlos@0
   124
      AD_REF_LIST_V L, C_UOM C1 
carlos@0
   125
      WHERE T.MOVEMENTTYPE = 'P+' 
carlos@0
   126
      AND T.MOVEMENTTYPE = L.VALUE 
carlos@0
   127
      AND L.AD_REFERENCE_ID = 189 
carlos@0
   128
      AND L.AD_LANGUAGE = ? 
carlos@0
   129
      AND T.C_UOM_ID = C1.C_UOM_ID 
carlos@0
   130
      AND EXISTS (SELECT 1 FROM M_PRODUCTIONLINE 
carlos@0
   131
        WHERE M_PRODUCTIONLINE_ID = T.M_PRODUCTIONLINE_ID 
carlos@0
   132
        AND M_PRODUCTIONPLAN_ID = (
carlos@423
   133
        SELECT M_PRODUCTIONPLAN_ID FROM M_PRODUCTIONLINE WHERE M_PRODUCTIONLINE_ID = TO_NUMBER(?))) 
carlos@0
   134
      AND T.MOVEMENTQTY > 0
carlos@423
   135
      AND T.M_PRODUCTIONLINE_ID <> TO_NUMBER(?)
carlos@0
   136
      AND T.M_ATTRIBUTESETINSTANCE_ID <> 0
carlos@0
   137
      ORDER BY T.MOVEMENTDATE, T.CREATED
carlos@0
   138
     ]]></Sql>
carlos@0
   139
     <Parameter name="adLanguage"/>
carlos@0
   140
     <Parameter name="adLanguage"/>
carlos@0
   141
     <Parameter name="adLanguage"/>
carlos@0
   142
     <Parameter name="adLanguage"/>
carlos@0
   143
     <Parameter name="adLanguage"/>
carlos@0
   144
     <Parameter name="adLanguage"/>
carlos@0
   145
     <Parameter name="adLanguage"/>
carlos@0
   146
     <Parameter name="adLanguage"/>
carlos@0
   147
     <Parameter name="mProductionlineId"/>
carlos@0
   148
     <Parameter name="mProductionlineId"/>
carlos@0
   149
  </SqlMethod>
carlos@0
   150
  <SqlMethod name="selectProductionIn" type="preparedStatement" return="multiple">
carlos@0
   151
    <SqlMethodComment></SqlMethodComment>
carlos@0
   152
    <Sql>
carlos@0
   153
    <![CDATA[
carlos@0
   154
      SELECT T.M_TRANSACTION_ID AS ID, T.MOVEMENTTYPE, T.M_LOCATOR_ID, T.M_PRODUCT_ID, T.MOVEMENTDATE, 
carlos@0
   155
      ROUND(T.MOVEMENTQTY,4) AS MOVEMENTQTY, T.M_INVENTORYLINE_ID, T.M_MOVEMENTLINE_ID, T.M_INOUTLINE_ID, T.M_PRODUCTIONLINE_ID, 
carlos@0
   156
      T.C_PROJECTISSUE_ID, T.M_ATTRIBUTESETINSTANCE_ID, T.M_PRODUCT_UOM_ID, ROUND(T.QUANTITYORDER,4) AS QUANTITYORDER, T.C_UOM_ID, 
carlos@0
   157
      L.NAME AS MOVEMENTTYPE_NAME, 
carlos@0
   158
      (CASE WHEN T.M_PRODUCT_UOM_ID IS NOT NULL THEN TO_CHAR(C2.UOMSYMBOL) END) AS PRODUCT_UOM_NAME, 
carlos@0
   159
      C1.UOMSYMBOL AS UOM_NAME, 
carlos@0
   160
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_Product'), TO_CHAR(T.M_PRODUCT_ID), TO_CHAR(?)) AS PRODUCT_NAME, 
carlos@0
   161
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_LOCATOR'), TO_CHAR(T.M_LOCATOR_ID), TO_CHAR(?)) AS LOCATOR_NAME, '' AS NAME, 
carlos@0
   162
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_InventoryLine'), TO_CHAR(T.M_INVENTORYLINE_ID), TO_CHAR(?)) AS INVENTORY_NAME, 
carlos@0
   163
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_MovementLine'), TO_CHAR(T.M_MOVEMENTLINE_ID), TO_CHAR(?)) AS MOVEMENT_NAME, 
carlos@0
   164
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_InoutLine'), TO_CHAR(T.M_INOUTLINE_ID), TO_CHAR(?)) AS INOUT_NAME, 
carlos@0
   165
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_AttributeSetInstance'), TO_CHAR(T.M_ATTRIBUTESETINSTANCE_ID), TO_CHAR(?)) AS ATTRIBUTE_NAME,
carlos@0
   166
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_ProductionLine'), TO_CHAR(T.M_PRODUCTIONLINE_ID), TO_CHAR(?)) AS PRODUCTION_NAME
carlos@0
   167
      FROM  M_PRODUCT_UOM M_P left join  C_UOM C2 on M_P.C_UOM_ID = C2.C_UOM_ID
carlos@0
   168
                              right join M_TRANSACTION T on M_P.M_PRODUCT_UOM_ID = T.M_PRODUCT_UOM_ID ,
carlos@0
   169
      AD_REF_LIST_V L, C_UOM C1
carlos@0
   170
      WHERE T.MOVEMENTTYPE = 'P+' 
carlos@0
   171
      AND T.MOVEMENTTYPE = L.VALUE 
carlos@0
   172
      AND L.AD_REFERENCE_ID = 189 
carlos@0
   173
      AND L.AD_LANGUAGE = ? 
carlos@0
   174
      AND T.C_UOM_ID = C1.C_UOM_ID 
carlos@0
   175
      AND EXISTS (SELECT 1 FROM M_PRODUCTIONLINE 
carlos@0
   176
        WHERE M_PRODUCTIONLINE_ID = T.M_PRODUCTIONLINE_ID 
carlos@0
   177
        AND M_PRODUCTIONPLAN_ID = (
carlos@423
   178
        SELECT M_PRODUCTIONPLAN_ID FROM M_PRODUCTIONLINE WHERE M_PRODUCTIONLINE_ID = TO_NUMBER(?))) 
carlos@0
   179
      AND T.MOVEMENTQTY < 0
carlos@423
   180
      AND T.M_PRODUCTIONLINE_ID <> TO_NUMBER(?)
carlos@0
   181
      AND T.M_ATTRIBUTESETINSTANCE_ID <> 0
carlos@0
   182
      ORDER BY T.MOVEMENTDATE, T.CREATED
carlos@0
   183
     ]]></Sql>
carlos@0
   184
     <Parameter name="adLanguage"/>
carlos@0
   185
     <Parameter name="adLanguage"/>
carlos@0
   186
     <Parameter name="adLanguage"/>
carlos@0
   187
     <Parameter name="adLanguage"/>
carlos@0
   188
     <Parameter name="adLanguage"/>
carlos@0
   189
     <Parameter name="adLanguage"/>
carlos@0
   190
     <Parameter name="adLanguage"/>
carlos@0
   191
     <Parameter name="adLanguage"/>
carlos@0
   192
     <Parameter name="mProductionlineId"/>
carlos@0
   193
     <Parameter name="mProductionlineId"/>
carlos@0
   194
  </SqlMethod>
carlos@0
   195
  <SqlMethod name="selectMovement" type="preparedStatement" return="multiple">
carlos@0
   196
    <SqlMethodComment></SqlMethodComment>
carlos@0
   197
    <Sql>
carlos@0
   198
    <![CDATA[
carlos@0
   199
      SELECT T.M_TRANSACTION_ID AS ID, T.MOVEMENTTYPE, T.M_LOCATOR_ID, T.M_PRODUCT_ID, T.MOVEMENTDATE, 
carlos@0
   200
      ROUND(T.MOVEMENTQTY,4) AS MOVEMENTQTY, T.M_INVENTORYLINE_ID, T.M_MOVEMENTLINE_ID, T.M_INOUTLINE_ID, T.M_PRODUCTIONLINE_ID, 
carlos@0
   201
      T.C_PROJECTISSUE_ID, T.M_ATTRIBUTESETINSTANCE_ID, T.M_PRODUCT_UOM_ID, ROUND(T.QUANTITYORDER,4) AS QUANTITYORDER, T.C_UOM_ID, 
carlos@0
   202
      L.NAME AS MOVEMENTTYPE_NAME, 
carlos@0
   203
      (CASE WHEN T.M_PRODUCT_UOM_ID IS NOT NULL THEN TO_CHAR(C2.UOMSYMBOL) END) AS PRODUCT_UOM_NAME, 
carlos@0
   204
      C1.UOMSYMBOL AS UOM_NAME, 
carlos@0
   205
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_Product'), TO_CHAR(T.M_PRODUCT_ID), TO_CHAR(?)) AS PRODUCT_NAME, 
carlos@0
   206
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_LOCATOR'), TO_CHAR(T.M_LOCATOR_ID), TO_CHAR(?)) AS LOCATOR_NAME, '' AS NAME, 
carlos@0
   207
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_InventoryLine'), TO_CHAR(T.M_INVENTORYLINE_ID), TO_CHAR(?)) AS INVENTORY_NAME, 
carlos@0
   208
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_MovementLine'), TO_CHAR(T.M_MOVEMENTLINE_ID), TO_CHAR(?)) AS MOVEMENT_NAME, 
carlos@0
   209
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_InoutLine'), TO_CHAR(T.M_INOUTLINE_ID), TO_CHAR(?)) AS INOUT_NAME, 
carlos@0
   210
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_AttributeSetInstance'), TO_CHAR(T.M_ATTRIBUTESETINSTANCE_ID), TO_CHAR(?)) AS ATTRIBUTE_NAME,
carlos@0
   211
      AD_COLUMN_IDENTIFIER(TO_CHAR('M_ProductionLine'), TO_CHAR(T.M_PRODUCTIONLINE_ID), TO_CHAR(?)) AS PRODUCTION_NAME
carlos@0
   212
      FROM M_PRODUCT_UOM M_P left join C_UOM C2 on  M_P.C_UOM_ID = C2.C_UOM_ID 
carlos@0
   213
                             right join M_TRANSACTION T on  M_P.M_PRODUCT_UOM_ID = T.M_PRODUCT_UOM_ID,
carlos@0
   214
      AD_REF_LIST_V L, C_UOM C1 
carlos@0
   215
      WHERE T.MOVEMENTTYPE = ?
carlos@0
   216
      AND T.MOVEMENTTYPE = L.VALUE 
carlos@0
   217
      AND L.AD_REFERENCE_ID = 189 
carlos@0
   218
      AND L.AD_LANGUAGE = ? 
carlos@0
   219
      AND T.C_UOM_ID = C1.C_UOM_ID 
carlos@423
   220
      AND T.M_MOVEMENTLINE_ID = TO_NUMBER(?)
carlos@0
   221
      AND T.M_ATTRIBUTESETINSTANCE_ID <> 0
carlos@0
   222
      ORDER BY T.MOVEMENTDATE, T.CREATED
carlos@0
   223
     ]]></Sql>
carlos@0
   224
     <Parameter name="adLanguage"/>
carlos@0
   225
     <Parameter name="adLanguage"/>
carlos@0
   226
     <Parameter name="adLanguage"/>
carlos@0
   227
     <Parameter name="adLanguage"/>
carlos@0
   228
     <Parameter name="adLanguage"/>
carlos@0
   229
     <Parameter name="adLanguage"/>
carlos@0
   230
     <Parameter name="adLanguage"/>
carlos@0
   231
     <Parameter name="movementtype"/>
carlos@0
   232
     <Parameter name="adLanguage"/>
carlos@0
   233
     <Parameter name="mMovementlineId"/>
carlos@0
   234
  </SqlMethod>
carlos@0
   235
carlos@0
   236
carlos@0
   237
  <SqlMethod name="selectMproduct" type="preparedStatement" return="String" default="">
carlos@0
   238
    <SqlMethodComment></SqlMethodComment>
carlos@0
   239
    <Sql>
carlos@0
   240
    <![CDATA[
carlos@0
   241
      SELECT M_PRODUCT.NAME
carlos@0
   242
      FROM M_PRODUCT
carlos@423
   243
      WHERE M_PRODUCT.M_PRODUCT_ID = TO_NUMBER(?)
carlos@0
   244
     ]]></Sql>
carlos@0
   245
    <Parameter name="mProductId"/>
carlos@0
   246
  </SqlMethod>
carlos@0
   247
</SqlClass>