Search in sources :

Example 6 with CustomerLevelEntity

use of org.mifos.customers.business.CustomerLevelEntity 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)

Example 7 with CustomerLevelEntity

use of org.mifos.customers.business.CustomerLevelEntity in project head by mifos.

the class CheckListBOIntegrationTest method testCreateCheckListExceptionForCustomerZeroDetails.

@Test
public void testCreateCheckListExceptionForCustomerZeroDetails() throws Exception {
    CustomerLevelEntity customerLevelEntity = new CustomerLevelEntity(CustomerLevel.CENTER);
    CustomerStatusEntity customerStatusEntity = new CustomerStatusEntity(CustomerStatus.CENTER_ACTIVE);
    try {
        customerCheckList = new CustomerCheckListBO(customerLevelEntity, customerStatusEntity, null, CheckListConstants.STATUS_ACTIVE, new ArrayList<String>(), (short) 1, (short) 1);
        Assert.fail();
    } catch (CheckListException ce) {
        Assert.assertTrue(true);
    }
}
Also used : CustomerLevelEntity(org.mifos.customers.business.CustomerLevelEntity) ArrayList(java.util.ArrayList) CustomerStatusEntity(org.mifos.customers.business.CustomerStatusEntity) CheckListException(org.mifos.customers.checklist.exceptions.CheckListException) Test(org.junit.Test)

Aggregations

CustomerLevelEntity (org.mifos.customers.business.CustomerLevelEntity)7 CustomerStatusEntity (org.mifos.customers.business.CustomerStatusEntity)5 CheckListException (org.mifos.customers.checklist.exceptions.CheckListException)4 Test (org.junit.Test)3 CustomerCheckListBO (org.mifos.customers.checklist.business.CustomerCheckListBO)3 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)2 UserContextFactory (org.mifos.accounts.servicefacade.UserContextFactory)2 MifosRuntimeException (org.mifos.core.MifosRuntimeException)2 PersistenceException (org.mifos.framework.exceptions.PersistenceException)2 MifosUser (org.mifos.security.MifosUser)2 UserContext (org.mifos.security.util.UserContext)2 BusinessRuleException (org.mifos.service.BusinessRuleException)2 ArrayList (java.util.ArrayList)1 AccountException (org.mifos.accounts.exceptions.AccountException)1 MultipleLoanAccountsCreationActionForm (org.mifos.accounts.loan.struts.actionforms.MultipleLoanAccountsCreationActionForm)1 MeetingBO (org.mifos.application.meeting.business.MeetingBO)1 CustomerLevel (org.mifos.customers.api.CustomerLevel)1 CustomerBO (org.mifos.customers.business.CustomerBO)1 CheckListPersistence (org.mifos.customers.checklist.persistence.CheckListPersistence)1 CustomerException (org.mifos.customers.exceptions.CustomerException)1