Package org.compiere.model
Class MConversionRateUtil
java.lang.Object
org.compiere.model.MConversionRateUtil
- Author:
- Teo Sarca, SC ARHIPAC SERVICE SRL
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
convertBase
(SetGetModel model, String DateName, String SourceAmtName, String AmtName, String changedColumnName) Convert an amount to base currency and update model fields (CurrencyRate, "AmtName").static String
getErrorMessage
(Properties ctx, String adMessage, int currencyFromID, int currencyToID, int convertionTypeID, Timestamp date, String trxName)
-
Method Details
-
convertBase
public static BigDecimal convertBase(SetGetModel model, String DateName, String SourceAmtName, String AmtName, String changedColumnName) Convert an amount to base currency and update model fields (CurrencyRate, "AmtName").- Parameters:
model
-DateName
- conversion date field nameSourceAmtName
- source amount field nameAmtName
- converted amount field name (optional); if null then the converted amount field will not be updatedchangedColumnName
- the column that has changed (the controller); optional- Returns:
- converted amount or null if error
-
getErrorMessage
public static String getErrorMessage(Properties ctx, String adMessage, int currencyFromID, int currencyToID, int convertionTypeID, Timestamp date, String trxName) - Parameters:
ctx
-adMessage
-currencyFromID
-currencyToID
-convertionTypeID
-date
-trxName
-- Returns:
- the message to show when no exchange rate is found
-