src/org/openbravo/erpCommon/ad_callouts/SE_Expense_Product_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
<SqlClass name="SEExpenseProductData" package="org.openbravo.erpCommon.ad_callouts">
carlos@0
    23
  <SqlMethod name="select" type="preparedStatement" return="multiple">
carlos@0
    24
    <SqlMethodComment></SqlMethodComment>
carlos@0
    25
    <Sql>
carlos@0
    26
      <![CDATA[
gorkaion@1787
    27
        SELECT M_BOM_PriceStd(p.M_Product_ID,pv.M_PriceList_Version_ID) AS PriceStd,
gorkaion@1787
    28
        M_BOM_PriceList(p.M_Product_ID,pv.M_PriceList_Version_ID) AS PriceList,
gorkaion@1787
    29
        M_BOM_PriceLimit(p.M_Product_ID,pv.M_PriceList_Version_ID) AS PriceLimit,
carlos@0
    30
        p.C_UOM_ID,pv.ValidFrom,pl.C_Currency_ID 
carlos@0
    31
        FROM M_Product p, M_ProductPrice pp, M_Pricelist pl, M_PriceList_Version pv 
carlos@0
    32
        WHERE p.M_Product_ID=pp.M_Product_ID
carlos@0
    33
        AND pp.M_PriceList_Version_ID=pv.M_PriceList_Version_ID
carlos@0
    34
        AND pv.M_PriceList_ID=pl.M_PriceList_ID
carlos@0
    35
        AND pv.IsActive='Y'
juanpablo@1605
    36
        AND p.M_Product_ID = ?
juanpablo@1605
    37
        AND pl.M_PriceList_ID = ?
carlos@0
    38
        ORDER BY pv.ValidFrom DESC
carlos@0
    39
      ]]>
carlos@0
    40
    </Sql>
carlos@0
    41
    <Parameter name="MProductID"/>
carlos@0
    42
    <Parameter name="MPriceListID"/>
carlos@0
    43
  </SqlMethod>
carlos@0
    44
  <SqlMethod name="selectBasePriceList" type="preparedStatement" return="multiple">
carlos@0
    45
    <SqlMethodComment></SqlMethodComment>
carlos@0
    46
    <Sql>
carlos@0
    47
      <![CDATA[
gorkaion@1787
    48
        SELECT M_BOM_PriceStd(p.M_Product_ID,pv.M_PriceList_Version_ID) AS PriceStd,
gorkaion@1787
    49
        M_BOM_PriceList(p.M_Product_ID,pv.M_PriceList_Version_ID) AS PriceList,
gorkaion@1787
    50
        M_BOM_PriceLimit(p.M_Product_ID,pv.M_PriceList_Version_ID) AS PriceLimit,
carlos@0
    51
        p.C_UOM_ID,pv.ValidFrom,pl.C_Currency_ID 
carlos@0
    52
        FROM M_Product p, M_ProductPrice pp, M_Pricelist pl, M_Pricelist bpl, M_PriceList_Version pv
carlos@0
    53
        WHERE p.M_Product_ID=pp.M_Product_ID
carlos@0
    54
        AND pp.M_PriceList_Version_ID=pv.M_PriceList_Version_ID
carlos@0
    55
        AND pv.M_PriceList_ID=bpl.M_PriceList_ID
carlos@0
    56
        AND pv.IsActive='Y'
carlos@0
    57
        AND bpl.M_PriceList_ID=pl.BasePriceList_ID
juanpablo@1605
    58
        AND p.M_Product_ID=?
juanpablo@1605
    59
        AND pl.M_PriceList_ID=?
carlos@0
    60
        ORDER BY pv.ValidFrom DESC
carlos@0
    61
      ]]>
carlos@0
    62
    </Sql>
carlos@0
    63
    <Parameter name="MProductID"/>
carlos@0
    64
    <Parameter name="MPriceListID"/>
carlos@0
    65
  </SqlMethod>
carlos@0
    66
  <SqlMethod name="priceList" type="preparedStatement" return="String" default="">
carlos@0
    67
    <SqlMethodComment></SqlMethodComment>
carlos@0
    68
    <Sql>
carlos@0
    69
      <![CDATA[
carlos@0
    70
        SELECT PO_PRICELIST_ID
carlos@0
    71
        FROM S_TIMEEXPENSE, C_BPARTNER
carlos@0
    72
        WHERE S_TIMEEXPENSE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
juanpablo@1605
    73
        AND S_TIMEEXPENSE.S_TIMEEXPENSE_ID = ?
carlos@0
    74
      ]]>
carlos@0
    75
    </Sql>
carlos@0
    76
    <Parameter name="sTimeexpenseId"/>
carlos@0
    77
  </SqlMethod>
carlos@0
    78
  <SqlMethod name="selectUOM" type="preparedStatement" return="String" default="">
carlos@0
    79
    <SqlMethodComment></SqlMethodComment>
carlos@0
    80
    <Sql>
carlos@0
    81
      <![CDATA[
carlos@0
    82
        SELECT C_UOM_ID
carlos@0
    83
        FROM M_PRODUCT
juanpablo@1605
    84
        WHERE M_PRODUCT_ID = ?
carlos@0
    85
      ]]>
carlos@0
    86
    </Sql>
carlos@0
    87
    <Parameter name="mProductId"/>
carlos@0
    88
  </SqlMethod>
rafael@1531
    89
  <SqlMethod name="selectConvertedAmt" type="preparedStatement" return="String" default="">
rafael@1531
    90
    <SqlMethodComment></SqlMethodComment>
rafael@1531
    91
    <Sql>
rafael@1531
    92
      <![CDATA[
juanpablo@1605
    93
        select c_currency_convert(TO_NUMBER(?),?,?,TO_DATE(?),null, ?,?) from dual
rafael@1531
    94
      ]]>
rafael@1531
    95
    </Sql>
rafael@1531
    96
    <Parameter name="expenseAmount"/>
rafael@1531
    97
    <Parameter name="currencyFrom"/>
rafael@1531
    98
    <Parameter name="currencyTo"/>
rafael@1531
    99
    <Parameter name="dateExpense"/>
rafael@1531
   100
    <Parameter name="client"/>
rafael@1531
   101
    <Parameter name="org"/>
rafael@1531
   102
  </SqlMethod>
carlos@1323
   103
  <SqlMethod name="selectPrecision" type="preparedStatement" return="String" default="">
carlos@1323
   104
    <SqlMethodComment></SqlMethodComment>
carlos@1323
   105
    <Sql>
carlos@1323
   106
      <![CDATA[
carlos@1323
   107
        SELECT PRICEPRECISION 
carlos@1323
   108
        FROM C_CURRENCY C
juanpablo@1605
   109
        WHERE C.C_CURRENCY_ID = ?
carlos@1323
   110
      ]]>
carlos@1323
   111
    </Sql>
carlos@1323
   112
    <Parameter name="cCurrencyId"/>
carlos@1323
   113
  </SqlMethod>
rafael@1531
   114
  <SqlMethod name="selectReportDate" type="preparedStatement" return="String" default="">
rafael@1531
   115
    <SqlMethodComment></SqlMethodComment>
rafael@1531
   116
    <Sql>
rafael@1531
   117
      <![CDATA[
rafael@1531
   118
        SELECT TO_CHAR(S.DATEREPORT) 
rafael@1531
   119
		FROM S_TIMEEXPENSE S
juanpablo@1605
   120
		WHERE S.S_TIMEEXPENSE_ID = ?
rafael@1531
   121
      ]]>
rafael@1531
   122
    </Sql>
rafael@1531
   123
    <Parameter name="sTimeExpenseId"/>
rafael@1531
   124
  </SqlMethod>
carlos@0
   125
</SqlClass>