src/org/openbravo/erpCommon/ad_callouts/SE_ProjectLine_Value_data.xsql
author RM packaging bot <staff.rm@openbravo.com>
Tue, 28 Jun 2011 10:33:23 +0000
changeset 9542 845811ab032b
parent 9072 79e55dfc8af0
permissions -rw-r--r--
Update AD_MODULE version to 2.50MP31
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
priya@9072
     5
 * Version  1.1  (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. 
ggi@6701
    14
 * The Initial Developer of the Original Code is Openbravo SLU 
ggi@6701
    15
 * All portions are Copyright (C) 2001-2006 Openbravo SLU 
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
<SqlClass name="SEProjectLineValueData" package="org.openbravo.erpCommon.ad_callouts">
carlos@0
    25
  <SqlMethod name="select" type="preparedStatement" return="multiple">
carlos@0
    26
    <SqlMethodComment></SqlMethodComment>
carlos@0
    27
    <Sql>
carlos@0
    28
      <![CDATA[
rafael@1171
    29
        select value, name, description, '' as project, '' as pricelist_version, '' as pricelist, '' as warehouse, '' as bplocation, '' as projcat, '' as plannedprice
rafael@1171
    30
        from m_product 
juanpablo@1605
    31
        where m_product_ID = ?
carlos@0
    32
      ]]>
carlos@0
    33
    </Sql>
carlos@0
    34
    <Parameter name="product"/>
carlos@0
    35
  </SqlMethod>
rafael@1171
    36
  <SqlMethod name="selectProject" type="preparedStatement" return="multiple" default="">
rafael@1171
    37
    <SqlMethodComment></SqlMethodComment>
rafael@1171
    38
    <Sql>
rafael@1171
    39
      SELECT C_Project.Projectcategory as projcat, C_Project.M_Pricelist_ID as pricelist, C_Project.M_Warehouse_Id as warehouse, C_Project.C_BPartner_Location_Id as bplocation
rafael@1171
    40
      FROM C_Project
juanpablo@1605
    41
      WHERE C_Project.C_Project_ID = ?
rafael@1171
    42
    </Sql>
rafael@1171
    43
    <Parameter name="cProjectId"/>
rafael@1171
    44
  </SqlMethod>
rafael@1171
    45
  <SqlMethod name="selectPhaseProject" type="preparedStatement" return="String" default="">
rafael@1171
    46
    <SqlMethodComment></SqlMethodComment>
rafael@1171
    47
    <Sql>
rafael@1171
    48
      SELECT c_projectphase.c_project_id
rafael@1171
    49
      FROM c_projectphase
juanpablo@1605
    50
      WHERE c_projectphase.c_projectphase_ID = ?
rafael@1171
    51
    </Sql>
rafael@1171
    52
    <Parameter name="cPhaseId"/>
rafael@1171
    53
  </SqlMethod>
rafael@1171
    54
  <SqlMethod name="selectPriceListVersion" type="preparedStatement" return="String" default="">
rafael@1171
    55
    <SqlMethodComment></SqlMethodComment>
rafael@1171
    56
    <Sql>
gorkaion@1787
    57
      SELECT M_GET_PRICELIST_VERSION(?, to_date(?)) as pricelist_version
rafael@1171
    58
      FROM DUAL
rafael@1171
    59
    </Sql>
rafael@1171
    60
    <Parameter name="mPriceListId"/>
rafael@1171
    61
    <Parameter name="date"/>
rafael@1171
    62
  </SqlMethod>
rafael@1171
    63
  <SqlMethod name="selectPlannedPrice" type="preparedStatement" return="String" default="0">
rafael@1171
    64
    <SqlMethodComment></SqlMethodComment>
rafael@1171
    65
    <Sql>
rafael@1171
    66
      SELECT ROUND((SELECT COALESCE(SUM(PriceStd), 0)
rafael@1171
    67
				    FROM M_ProductPrice
juanpablo@1605
    68
				    WHERE M_PriceList_Version_id = ?
juanpablo@1605
    69
				      AND M_Product_id = ?),
rafael@1171
    70
                   (SELECT PRICEPRECISION 
rafael@1171
    71
                       FROM C_CURRENCY C,
rafael@1171
    72
                            C_PROJECT P 
rafael@1171
    73
                      WHERE C.C_CURRENCY_ID = P.C_CURRENCY_ID
juanpablo@1605
    74
                        AND P.C_PROJECT_ID = ?)) AS plannedprice FROM DUAL
rafael@1171
    75
    </Sql>
rafael@1171
    76
    <Parameter name="mPriceListVersionId"/>
rafael@1171
    77
    <Parameter name="mProductId"/>
rafael@1171
    78
    <Parameter name="cProjectId"/>    
rafael@1171
    79
  </SqlMethod>
carlos@0
    80
  <SqlMethod name="set" type="constant" return="multiple">
carlos@0
    81
      <SqlMethodComment></SqlMethodComment>
carlos@0
    82
      <Sql></Sql>
carlos@0
    83
   </SqlMethod>
carlos@0
    84
</SqlClass>