Search in sources :

Example 16 with CreateLoanAccount

use of org.mifos.clientportfolio.newloan.applicationservice.CreateLoanAccount in project head by mifos.

the class GroupLoanAccountController method prepareGroupLoanAccountMember.

private CreateLoanAccount prepareGroupLoanAccountMember(Integer accountState, LoanAccountFormBean formBean, LocalDate disbursementDate, RecurringSchedule recurringSchedule, List<CreateAccountFeeDto> accountFees, List<CreateAccountPenaltyDto> accountPenalties, BigDecimal loanAmount, BigDecimal minAllowedLoanAmount, BigDecimal maxAllowedLoanAmount, int index) {
    Integer memberId = this.groupLoanAccountServiceFacade.getMemberClientId(formBean.getClientGlobalId()[index]);
    CreateLoanAccount loanAccountDetails = new CreateLoanAccount(memberId, formBean.getProductId(), accountState, BigDecimal.valueOf(formBean.getClientAmount()[index].doubleValue()), minAllowedLoanAmount, maxAllowedLoanAmount, formBean.getInterestRate().doubleValue(), disbursementDate, null, formBean.getNumberOfInstallments().intValue(), formBean.getMinNumberOfInstallments().intValue(), formBean.getMaxNumberOfInstallments().intValue(), formBean.getGraceDuration().intValue(), formBean.getFundId(), formBean.getClientLoanPurposeId()[index], formBean.getCollateralTypeId(), formBean.getCollateralNotes(), formBean.getExternalId(), formBean.isRepaymentScheduleIndependentOfCustomerMeeting(), recurringSchedule, accountFees, accountPenalties);
    return loanAccountDetails;
}
Also used : CreateLoanAccount(org.mifos.clientportfolio.newloan.applicationservice.CreateLoanAccount)

Example 17 with CreateLoanAccount

use of org.mifos.clientportfolio.newloan.applicationservice.CreateLoanAccount 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);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) LocalDate(org.joda.time.LocalDate) Date(java.util.Date) LocalDate(org.joda.time.LocalDate) BigDecimal(java.math.BigDecimal) RecurringSchedule(org.mifos.clientportfolio.loan.service.RecurringSchedule) CreateLoanAccount(org.mifos.clientportfolio.newloan.applicationservice.CreateLoanAccount) CreateAccountPenaltyDto(org.mifos.dto.domain.CreateAccountPenaltyDto) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) CreateAccountFeeDto(org.mifos.dto.domain.CreateAccountFeeDto)

Aggregations

CreateLoanAccount (org.mifos.clientportfolio.newloan.applicationservice.CreateLoanAccount)17 ArrayList (java.util.ArrayList)15 CreateAccountPenaltyDto (org.mifos.dto.domain.CreateAccountPenaltyDto)14 BigDecimal (java.math.BigDecimal)13 LocalDate (org.joda.time.LocalDate)13 RecurringSchedule (org.mifos.clientportfolio.loan.service.RecurringSchedule)12 CreateAccountFeeDto (org.mifos.dto.domain.CreateAccountFeeDto)12 MeetingBO (org.mifos.application.meeting.business.MeetingBO)8 MifosUser (org.mifos.security.MifosUser)6 HashMap (java.util.HashMap)5 List (java.util.List)5 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)5 LoanCreationResultDto (org.mifos.dto.screen.LoanCreationResultDto)5 Date (java.util.Date)4 DateTime (org.joda.time.DateTime)4 AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)4 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)4 LoanBO (org.mifos.accounts.loan.business.LoanBO)3 CreateGlimLoanAccount (org.mifos.clientportfolio.newloan.applicationservice.CreateGlimLoanAccount)3 GroupMemberAccountDto (org.mifos.clientportfolio.newloan.applicationservice.GroupMemberAccountDto)3