use of org.mifos.dto.domain.CreateAccountFeeDto in project head by mifos.
the class LoanCreationHelper method translateToAdditionalAccountFeeDtos.
public static List<CreateAccountFeeDto> translateToAdditionalAccountFeeDtos(LoanAccountFormBean formBean) {
List<CreateAccountFeeDto> accountFees = new ArrayList<CreateAccountFeeDto>();
int index = 0;
CreateAccountFeeDto accountFee = null;
for (Number feeId : formBean.getSelectedFeeId()) {
if (feeId != null) {
Number feeAmountOrRate = formBean.getSelectedFeeAmount()[index];
accountFee = new CreateAccountFeeDto(feeId.intValue(), feeAmountOrRate.toString());
accountFees.add(accountFee);
}
index++;
}
return accountFees;
}
use of org.mifos.dto.domain.CreateAccountFeeDto in project head by mifos.
the class LoanCreationHelper method translateToMemberAccountsFeeDtos.
public static Map<String, List<CreateAccountFeeDto>> translateToMemberAccountsFeeDtos(LoanAccountFormBean formBean) {
Map<String, List<CreateAccountFeeDto>> memberAccountsFees = new HashMap<String, List<CreateAccountFeeDto>>();
Number[] defaultFeeIds = formBean.getDefaultFeeId();
String[] memberGlobalIds = formBean.getClientGlobalId();
if (defaultFeeIds != null) {
int memberIndex = 0;
CreateAccountFeeDto accountFee = null;
for (String memberId : memberGlobalIds) {
if (formBean.getClientAmount()[memberIndex] != null) {
List<CreateAccountFeeDto> accountFees = new ArrayList<CreateAccountFeeDto>();
int feeIndex = 0;
for (Number feeId : defaultFeeIds) {
Boolean removeDefaultFeeSelected = formBean.getDefaultFeeSelected()[feeIndex];
if (removeDefaultFeeSelected == null || !removeDefaultFeeSelected) {
Number amount = formBean.getDefaultFeeIndividualAmounts()[feeIndex][memberIndex];
accountFee = new CreateAccountFeeDto(feeId.intValue(), amount.toString());
accountFees.add(accountFee);
}
feeIndex++;
}
memberAccountsFees.put(memberId, accountFees);
}
memberIndex++;
}
}
return memberAccountsFees;
}
use of org.mifos.dto.domain.CreateAccountFeeDto in project head by mifos.
the class LoanArrearsAgingHelperIntegrationTest method createBasicLoanAccount.
private LoanBO createBasicLoanAccount(final CustomerBO customer, final AccountState state, final LoanOfferingBO loanOffering, String loanAmountAsString, short numInstallments, double interestRate) {
MeetingBO meeting = TestObjectFactory.createLoanMeeting(customer.getCustomerMeeting().getMeeting());
List<Date> meetingDates = TestObjectFactory.getMeetingDates(customer.getOfficeId(), meeting, numInstallments);
LoanOfferingBO loanProduct = IntegrationTestObjectMother.findLoanProductBySystemId(loanOffering.getGlobalPrdOfferingNum());
BigDecimal loanAmount = BigDecimal.valueOf(Double.valueOf(loanAmountAsString));
BigDecimal minAllowedLoanAmount = loanAmount;
BigDecimal maxAllowedLoanAmount = loanAmount;
LocalDate disbursementDate = new LocalDate(meetingDates.get(0));
int numberOfInstallments = numInstallments;
int minAllowedNumberOfInstallments = loanProduct.getEligibleInstallmentSameForAllLoan().getMaxNoOfInstall();
int maxAllowedNumberOfInstallments = loanProduct.getEligibleInstallmentSameForAllLoan().getMaxNoOfInstall();
int graceDuration = 0;
Integer sourceOfFundId = null;
Integer loanPurposeId = null;
Integer collateralTypeId = null;
String collateralNotes = null;
String externalId = null;
boolean repaymentScheduleIndependentOfCustomerMeeting = false;
RecurringSchedule recurringSchedule = null;
List<CreateAccountFeeDto> accountFees = new ArrayList<CreateAccountFeeDto>();
CreateLoanAccount createLoanAccount = new CreateLoanAccount(customer.getCustomerId(), loanProduct.getPrdOfferingId().intValue(), state.getValue().intValue(), loanAmount, minAllowedLoanAmount, maxAllowedLoanAmount, interestRate, disbursementDate, null, numberOfInstallments, minAllowedNumberOfInstallments, maxAllowedNumberOfInstallments, graceDuration, sourceOfFundId, loanPurposeId, collateralTypeId, collateralNotes, externalId, repaymentScheduleIndependentOfCustomerMeeting, recurringSchedule, accountFees, new ArrayList<CreateAccountPenaltyDto>());
return IntegrationTestObjectMother.createClientLoan(createLoanAccount);
}
Aggregations