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