Search in sources :

Example 81 with LoanOfferingBO

use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.

the class LegacyLoanDaoIntegrationTest method getLoanAccount.

private AccountBO getLoanAccount(final CustomerBO customer, final MeetingBO meeting) {
    Date startDate = new Date(System.currentTimeMillis());
    LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering("Loancfgb", "dhsq", ApplicableTo.GROUPS, startDate, PrdStatus.LOAN_ACTIVE, 300.0, 1.2, (short) 3, InterestType.FLAT, meeting);
    return TestObjectFactory.createLoanAccount("42423142341", customer, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, startDate, loanOffering);
}
Also used : LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) Date(java.sql.Date)

Example 82 with LoanOfferingBO

use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.

the class LegacyLoanDaoIntegrationTest method getLoanAccount.

private AccountBO getLoanAccount(final String shortName, final CustomerBO customer, final MeetingBO meeting, final AccountState state) {
    Date startDate = new Date(System.currentTimeMillis());
    LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering("Loan123", shortName, ApplicableTo.GROUPS, startDate, PrdStatus.LOAN_ACTIVE, 300.0, 1.2, (short) 3, InterestType.FLAT, meeting);
    final int disbursalType = 1;
    return TestObjectFactory.createLoanAccountWithDisbursement("42423142341", customer, state, startDate, loanOffering, disbursalType);
}
Also used : LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) Date(java.sql.Date)

Example 83 with LoanOfferingBO

use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.

the class LegacyLoanDaoIntegrationTest method testGetLoanOffering.

@Test
public void testGetLoanOffering() throws Exception {
    LoanOfferingBO loanOffering = TestObjectFactory.createCompleteLoanOfferingObject();
    LoanOfferingBO loanOfferingBO = legacyLoanDao.getLoanOffering(loanOffering.getPrdOfferingId(), TestObjectFactory.TEST_LOCALE);
    Assert.assertEquals(loanOfferingBO.getPrdOfferingId(), loanOffering.getPrdOfferingId());
    TestObjectFactory.removeObject(loanOfferingBO);
}
Also used : LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) Test(org.junit.Test)

Example 84 with LoanOfferingBO

use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.

the class LoanPrdAction method get.

@TransactionDemarcate(saveToken = true)
public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    LoanPrdActionForm loanPrdActionForm = (LoanPrdActionForm) form;
    logger.debug("start get method of Loan Product Action" + loanPrdActionForm.getPrdOfferingId());
    LoanOfferingBO loanOffering = loanPrdBusinessService.getLoanOffering(loanPrdActionForm.getPrdOfferingIdValue(), getUserContext(request).getLocaleId());
    SessionUtils.setAttribute(ProductDefinitionConstants.LOANAMOUNTTYPE, loanOffering.checkLoanAmountType(), request);
    SessionUtils.setAttribute(ProductDefinitionConstants.INSTALLTYPE, loanOffering.checkNoOfInstallType(), request);
    SessionUtils.setAttribute(Constants.BUSINESS_KEY, loanOffering, request);
    loanPrdActionForm.clear();
    loanPrdActionForm.setPrdOfferingId(getStringValue(loanOffering.getPrdOfferingId()));
    request.getSession().setAttribute("isMultiCurrencyEnabled", AccountingRules.isMultiCurrencyEnabled());
    request.setAttribute("GlNamesMode", AccountingRules.getGlNamesMode());
    setSelectedQuestionGroupsOnSession(request, loanOffering, getQuestionnaireServiceFacade(request));
    logger.debug("get method of Loan Product Action called" + loanOffering.getPrdOfferingId());
    return mapping.findForward(ActionForwards.get_success.toString());
}
Also used : LoanPrdActionForm(org.mifos.accounts.productdefinition.struts.actionforms.LoanPrdActionForm) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 85 with LoanOfferingBO

use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.

the class MultipleLoanAccountsCreationAction method getPrdOfferings.

@TransactionDemarcate(joinToken = true)
public ActionForward getPrdOfferings(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    MultipleLoanAccountsCreationActionForm loanActionForm = (MultipleLoanAccountsCreationActionForm) form;
    Integer customerId = getIntegerValue(loanActionForm.getCenterId());
    CustomerBO customer = this.customerDao.findCustomerById(customerId);
    loanActionForm.setCenterSearchId(customer.getSearchId());
    List<LoanOfferingBO> loanOfferings = this.loanProductDao.findActiveLoanProductsApplicableToCustomerLevel(new CustomerLevelEntity(CustomerLevel.CLIENT));
    MeetingBO customerMeeting = customer.getCustomerMeetingValue();
    for (Iterator<LoanOfferingBO> iter = loanOfferings.iterator(); iter.hasNext(); ) {
        LoanOfferingBO loanOffering = iter.next();
        if (!isMeetingMatched(customerMeeting, loanOffering.getLoanOfferingMeeting().getMeeting())) {
            iter.remove();
        }
    }
    SessionUtils.setCollectionAttribute(LoanConstants.LOANPRDOFFERINGS, loanOfferings, request);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) CustomerLevelEntity(org.mifos.customers.business.CustomerLevelEntity) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) CustomerBO(org.mifos.customers.business.CustomerBO) MultipleLoanAccountsCreationActionForm(org.mifos.accounts.loan.struts.actionforms.MultipleLoanAccountsCreationActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)135 MeetingBO (org.mifos.application.meeting.business.MeetingBO)44 Date (java.util.Date)37 Test (org.junit.Test)37 ArrayList (java.util.ArrayList)26 Date (java.sql.Date)21 LoanBO (org.mifos.accounts.loan.business.LoanBO)18 LocalDate (org.joda.time.LocalDate)17 CustomerBO (org.mifos.customers.business.CustomerBO)12 LoanProductBuilder (org.mifos.domain.builders.LoanProductBuilder)11 UserContext (org.mifos.security.util.UserContext)9 ClientBuilder (org.mifos.domain.builders.ClientBuilder)8 Money (org.mifos.framework.util.helpers.Money)8 MifosUser (org.mifos.security.MifosUser)8 BusinessRuleException (org.mifos.service.BusinessRuleException)8 ProductCategoryBO (org.mifos.accounts.productdefinition.business.ProductCategoryBO)7 MifosRuntimeException (org.mifos.core.MifosRuntimeException)7 BigDecimal (java.math.BigDecimal)6 AccountException (org.mifos.accounts.exceptions.AccountException)6 FeeBO (org.mifos.accounts.fees.business.FeeBO)6