use of org.mifos.framework.util.LocalizationConverter in project head by mifos.
the class CollectionSheetEntryDto method setSavinsgAmountsEntered.
public void setSavinsgAmountsEntered(final Short prdOfferingId, final String depositAmountEnteredValue, final String withDrawalAmountEnteredValue) {
for (SavingsAccountDto savingsAccountDto : savingsAccountDetails) {
if (prdOfferingId.equals(savingsAccountDto.getSavingsOfferingId())) {
savingsAccountDto.setDepositAmountEntered(depositAmountEnteredValue);
savingsAccountDto.setWithDrawalAmountEntered(withDrawalAmountEnteredValue);
try {
if (depositAmountEnteredValue != null && !"".equals(depositAmountEnteredValue.trim())) {
new LocalizationConverter().getDoubleValueForCurrentLocale(depositAmountEnteredValue);
savingsAccountDto.setValidDepositAmountEntered(true);
}
} catch (NumberFormatException nfe) {
savingsAccountDto.setValidDepositAmountEntered(false);
}
try {
if (withDrawalAmountEnteredValue != null && !"".equals(withDrawalAmountEnteredValue.trim())) {
new LocalizationConverter().getDoubleValueForCurrentLocale(withDrawalAmountEnteredValue);
savingsAccountDto.setValidWithDrawalAmountEntered(true);
}
} catch (NumberFormatException nfe) {
savingsAccountDto.setValidWithDrawalAmountEntered(false);
}
}
}
}
use of org.mifos.framework.util.LocalizationConverter in project head by mifos.
the class CollectionSheetEntryDto method setLoanAmountsEntered.
public void setLoanAmountsEntered(final Short prdOfferingId, final String enteredAmountValue, final String disbursementAmount) {
for (LoanAccountsProductDto loanAccountView : loanAccountDetails) {
if (prdOfferingId.equals(loanAccountView.getPrdOfferingId())) {
loanAccountView.setEnteredAmount(enteredAmountValue);
loanAccountView.setDisBursementAmountEntered(disbursementAmount);
try {
if (null != enteredAmountValue) {
new LocalizationConverter().getDoubleValueForCurrentLocale(enteredAmountValue);
}
loanAccountView.setValidAmountEntered(true);
} catch (NumberFormatException ne) {
loanAccountView.setValidAmountEntered(false);
}
try {
if (null != disbursementAmount) {
new LocalizationConverter().getDoubleValueForCurrentLocale(disbursementAmount);
}
loanAccountView.setValidDisbursementAmount(true);
} catch (NumberFormatException ne) {
loanAccountView.setValidDisbursementAmount(false);
}
}
}
}
use of org.mifos.framework.util.LocalizationConverter in project head by mifos.
the class AccountBusinessService method populaleApplicableCharge.
private void populaleApplicableCharge(List<ApplicableCharge> applicableChargeList, List<FeeBO> feeList, UserContext userContext) {
for (FeeBO fee : feeList) {
ApplicableCharge applicableCharge = new ApplicableCharge();
applicableCharge.setFeeId(fee.getFeeId().toString());
applicableCharge.setFeeName(fee.getFeeName());
applicableCharge.setIsPenaltyType(false);
if (fee.getFeeType().getValue().equals(RateAmountFlag.RATE.getValue())) {
applicableCharge.setAmountOrRate(new LocalizationConverter().getDoubleStringForInterest(((RateFeeBO) fee).getRate()));
applicableCharge.setFormula(((RateFeeBO) fee).getFeeFormula().getFormulaStringThatHasName());
applicableCharge.setIsRateType(true);
} else {
applicableCharge.setAmountOrRate(((AmountFeeBO) fee).getFeeAmount().toString());
applicableCharge.setIsRateType(false);
}
MeetingBO meeting = fee.getFeeFrequency().getFeeMeetingFrequency();
if (meeting != null) {
applicableCharge.setPeriodicity(new MeetingHelper().getDetailMessageWithFrequency(meeting, userContext));
} else {
applicableCharge.setPaymentType(fee.getFeeFrequency().getFeePayment().getName());
}
applicableChargeList.add(applicableCharge);
}
}
use of org.mifos.framework.util.LocalizationConverter in project head by mifos.
the class GroupServiceFacadeWebTier method convertFeeViewsToAccountFeeEntities.
private List<AccountFeesEntity> convertFeeViewsToAccountFeeEntities(List<ApplicableAccountFeeDto> feesToApply) {
List<AccountFeesEntity> feesForCustomerAccount = new ArrayList<AccountFeesEntity>();
for (ApplicableAccountFeeDto feeDto : feesToApply) {
FeeBO fee = feeDao.findById(feeDto.getFeeId().shortValue());
Double feeAmount = new LocalizationConverter().getDoubleValueForCurrentLocale(feeDto.getAmount());
AccountBO nullReferenceForNow = null;
AccountFeesEntity accountFee = new AccountFeesEntity(nullReferenceForNow, fee, feeAmount);
feesForCustomerAccount.add(accountFee);
}
return feesForCustomerAccount;
}
use of org.mifos.framework.util.LocalizationConverter in project head by mifos.
the class ClientServiceFacadeWebTier method convertFeeViewsToAccountFeeEntities.
private List<AccountFeesEntity> convertFeeViewsToAccountFeeEntities(List<ApplicableAccountFeeDto> feesToApply) {
List<AccountFeesEntity> feesForCustomerAccount = new ArrayList<AccountFeesEntity>();
for (ApplicableAccountFeeDto feeDto : feesToApply) {
FeeBO fee = this.feeDao.findById(feeDto.getFeeId().shortValue());
Double feeAmount = new LocalizationConverter().getDoubleValueForCurrentLocale(feeDto.getAmount());
AccountBO nullReferenceForNow = null;
AccountFeesEntity accountFee = new AccountFeesEntity(nullReferenceForNow, fee, feeAmount);
feesForCustomerAccount.add(accountFee);
}
return feesForCustomerAccount;
}
Aggregations