Search in sources :

Example 6 with ConversionError

use of org.mifos.framework.util.helpers.ConversionError in project head by mifos.

the class SingleGeneralLedgerActionForm method validateAmount.

protected DoubleConversionResult validateAmount(String amountString, MifosCurrency currency, String fieldPropertyKey, ActionErrors errors, String installmentNo) {
    String fieldName = fieldPropertyKey;
    DoubleConversionResult conversionResult = parseDoubleDecimalForMoney(amountString, currency);
    for (ConversionError error : conversionResult.getErrors()) {
        String errorText = error.toLocalizedMessage(currency);
        addError(errors, fieldName, "errors.generic", fieldName, errorText);
    }
    return conversionResult;
}
Also used : ConversionError(org.mifos.framework.util.helpers.ConversionError) DoubleConversionResult(org.mifos.framework.util.helpers.DoubleConversionResult)

Example 7 with ConversionError

use of org.mifos.framework.util.helpers.ConversionError in project head by mifos.

the class InterOfficeTransferActionForm method validateAmount.

protected DoubleConversionResult validateAmount(String amountString, MifosCurrency currency, String fieldPropertyKey, ActionErrors errors, String installmentNo) {
    String fieldName = fieldPropertyKey;
    DoubleConversionResult conversionResult = parseDoubleDecimalForMoney(amountString, currency);
    for (ConversionError error : conversionResult.getErrors()) {
        String errorText = error.toLocalizedMessage(currency);
        addError(errors, fieldName, "errors.generic", fieldName, errorText);
    }
    return conversionResult;
}
Also used : ConversionError(org.mifos.framework.util.helpers.ConversionError) DoubleConversionResult(org.mifos.framework.util.helpers.DoubleConversionResult)

Example 8 with ConversionError

use of org.mifos.framework.util.helpers.ConversionError in project head by mifos.

the class JournalVoucherActionForm method validateAmount.

protected DoubleConversionResult validateAmount(String amountString, MifosCurrency currency, String fieldPropertyKey, ActionErrors errors, String installmentNo) {
    String fieldName = fieldPropertyKey;
    DoubleConversionResult conversionResult = parseDoubleDecimalForMoney(amountString, currency);
    for (ConversionError error : conversionResult.getErrors()) {
        String errorText = error.toLocalizedMessage(currency);
        addError(errors, fieldName, "errors.generic", fieldName, errorText);
    }
    return conversionResult;
}
Also used : ConversionError(org.mifos.framework.util.helpers.ConversionError) DoubleConversionResult(org.mifos.framework.util.helpers.DoubleConversionResult)

Example 9 with ConversionError

use of org.mifos.framework.util.helpers.ConversionError in project head by mifos.

the class MultipleGeneralLedgerActionForm method validateAmount.

protected DoubleConversionResult validateAmount(String amountString, MifosCurrency currency, String fieldPropertyKey, ActionErrors errors, String installmentNo) {
    String fieldName = fieldPropertyKey;
    DoubleConversionResult conversionResult = parseDoubleDecimalForMoney(amountString, currency);
    for (ConversionError error : conversionResult.getErrors()) {
        String errorText = error.toLocalizedMessage(currency);
        addError(errors, fieldName, "errors.generic", fieldName, errorText);
    }
    return conversionResult;
}
Also used : ConversionError(org.mifos.framework.util.helpers.ConversionError) DoubleConversionResult(org.mifos.framework.util.helpers.DoubleConversionResult)

Example 10 with ConversionError

use of org.mifos.framework.util.helpers.ConversionError in project head by mifos.

the class OpenBalanceActionForm method validateAmount.

protected DoubleConversionResult validateAmount(String amountString, MifosCurrency currency, String fieldPropertyKey, ActionErrors errors, String installmentNo) {
    String fieldName = fieldPropertyKey;
    DoubleConversionResult conversionResult = parseDoubleDecimalForMoney(amountString, currency);
    for (ConversionError error : conversionResult.getErrors()) {
        String errorText = error.toLocalizedMessage(currency);
        addError(errors, fieldName, "errors.generic", fieldName, errorText);
    }
    return conversionResult;
}
Also used : ConversionError(org.mifos.framework.util.helpers.ConversionError) DoubleConversionResult(org.mifos.framework.util.helpers.DoubleConversionResult)

Aggregations

ConversionError (org.mifos.framework.util.helpers.ConversionError)22 DoubleConversionResult (org.mifos.framework.util.helpers.DoubleConversionResult)20 ArrayList (java.util.ArrayList)6 LocalizationConverter (org.mifos.framework.util.LocalizationConverter)1 ErrorEntry (org.mifos.platform.validations.ErrorEntry)1