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());
}
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);
}
}
Aggregations