use of org.mifos.framework.util.helpers.ConversionError in project head by mifos.
the class InstallmentFormatValidatorImpl method processConversionErrors.
private void processConversionErrors(RepaymentScheduleInstallment installment, String identifier, List<ConversionError> conversionErrors, List<ErrorEntry> errorEntries) {
for (ConversionError error : conversionErrors) {
String errorText = error.toLocalizedMessage(installment.getCurrency());
errorEntries.add(new ErrorEntry(INSTALLMENT_TOTAL_AMOUNT_INVALID, identifier, errorText));
}
}
use of org.mifos.framework.util.helpers.ConversionError in project head by mifos.
the class InstallmentFormatValidatorImpl method setTotalAmountValue.
private void setTotalAmountValue(RepaymentScheduleInstallment installment, String identifier, List<ErrorEntry> errorEntries) {
LocalizationConverter localizationConverter = new LocalizationConverter(installment.getCurrency());
DoubleConversionResult conversionResult = localizationConverter.parseDoubleForInstallmentTotalAmount(installment.getTotal());
List<ConversionError> conversionErrors = conversionResult.getErrors();
if (conversionErrors.isEmpty()) {
installment.setTotalValue(conversionResult.getDoubleValue());
} else {
processConversionErrors(installment, identifier, conversionErrors, errorEntries);
}
}
Aggregations