Class MConversionRateUtil


  • public final class MConversionRateUtil
    extends Object
    Author:
    Teo Sarca, SC ARHIPAC SERVICE SRL
    • Method Detail

      • 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 name
        SourceAmtName - source amount field name
        AmtName - converted amount field name (optional); if null then the converted amount field will not be updated
        changedColumnName - 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)
        Return the message to show when no exchange rate is found