Adempiere 3.5.2a

org.compiere.sqlj
Class Currency

java.lang.Object
  extended by org.compiere.sqlj.Currency

public class Currency
extends Object

SQLJ Currency related Functions

Version:
$Id: Currency.java,v 1.3 2006/07/30 00:59:07 jjanke Exp $
Author:
Jorg Janke

Constructor Summary
Currency()
           
 
Method Summary
static BigDecimal base(BigDecimal p_Amount, int p_C_CurrencyFrom_ID, Timestamp p_ConversionDate, int p_AD_Client_ID, int p_AD_Org_ID)
          Convert Amount to base Currency.
static BigDecimal convert(BigDecimal p_Amount, int p_C_CurrencyFrom_ID, int p_C_CurrencyTo_ID, Timestamp p_ConversionDate, int p_C_ConversionType_ID, int p_AD_Client_ID, int p_AD_Org_ID)
          Convert Amount to Currency.
static BigDecimal rate(int p_C_CurrencyFrom_ID, int p_C_CurrencyTo_ID, Timestamp p_ConversionDate, int p_C_ConversionType_ID, int p_AD_Client_ID, int p_AD_Org_ID)
          Get Conversion Rate.
static BigDecimal round(BigDecimal p_Amount, int p_C_Currency_ID, String p_Costing)
          Round amount to Currency precision.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Currency

public Currency()
Method Detail

base

public static BigDecimal base(BigDecimal p_Amount,
                              int p_C_CurrencyFrom_ID,
                              Timestamp p_ConversionDate,
                              int p_AD_Client_ID,
                              int p_AD_Org_ID)
                       throws SQLException
Convert Amount to base Currency. (default conversion type) Previously: C_Base_Convert - Now: currencyBase

Parameters:
p_Amount - amount
p_C_CurrencyFrom_ID - from currency
p_ConversionDate - conversion date
p_AD_Client_ID - client
p_AD_Org_ID - org
Returns:
rate or null
Throws:
SQLException

convert

public static BigDecimal convert(BigDecimal p_Amount,
                                 int p_C_CurrencyFrom_ID,
                                 int p_C_CurrencyTo_ID,
                                 Timestamp p_ConversionDate,
                                 int p_C_ConversionType_ID,
                                 int p_AD_Client_ID,
                                 int p_AD_Org_ID)
                          throws SQLException
Convert Amount to Currency. Previously: currencyConvert - Now: currencyConvert

Parameters:
p_Amount - amount
p_C_CurrencyFrom_ID - from currency
p_C_CurrencyTo_ID - to currency
p_ConversionDate - conversion date
p_C_ConversionType_ID - conversion type
p_AD_Client_ID - client
p_AD_Org_ID - org
Returns:
rate or null
Throws:
SQLException

rate

public static BigDecimal rate(int p_C_CurrencyFrom_ID,
                              int p_C_CurrencyTo_ID,
                              Timestamp p_ConversionDate,
                              int p_C_ConversionType_ID,
                              int p_AD_Client_ID,
                              int p_AD_Org_ID)
                       throws SQLException
Get Conversion Rate. Previously: C_Currency_Rate - Now: currencyRate

Parameters:
p_C_CurrencyFrom_ID - from currency
p_C_CurrencyTo_ID - to currency
p_ConversionDate - conversion date
p_C_ConversionType_ID - conversion type
p_AD_Client_ID - client
p_AD_Org_ID - org
Returns:
rate or null
Throws:
SQLException

round

public static BigDecimal round(BigDecimal p_Amount,
                               int p_C_Currency_ID,
                               String p_Costing)
                        throws SQLException
Round amount to Currency precision. SELECT ISO_CODE, currencyRound(111.111111, C_Currency_ID, 'N') "Std", currencyRound(111.111111, C_Currency_ID, 'Y') "Cost" FROM C_Currency WHERE C_Currency_ID IN (100,113)

Parameters:
p_Amount - amount
p_C_Currency_ID - currency
p_Costing - Y if costing precision
Returns:
rounded amount
Throws:
SQLException

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.