use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class MultipleLoanAccountsCreationAction method get.
@TransactionDemarcate(joinToken = true)
public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
MultipleLoanAccountsCreationActionForm loanActionForm = (MultipleLoanAccountsCreationActionForm) form;
String searchId = loanActionForm.getCenterSearchId();
Short branchId = getShortValue(loanActionForm.getBranchOfficeId());
Integer productId = Integer.parseInt(loanActionForm.getPrdOfferingId());
MultipleLoanAccountDetailsDto multipleLoanDetails = this.loanAccountServiceFacade.retrieveMultipleLoanAccountDetails(searchId, branchId, productId);
List<ClientBO> clients = this.customerDao.findActiveClientsUnderParent(searchId, branchId);
if (clients.isEmpty()) {
throw new BusinessRuleException(LoanConstants.NOSEARCHRESULTS);
}
LoanOfferingBO loanOffering = this.loanProductDao.findById(productId);
List<MultipleLoanCreationDto> multipleLoanDetailsXX = buildClientViewHelper(loanOffering, clients);
loanActionForm.setClientDetails(multipleLoanDetailsXX);
SessionUtils.setAttribute(LoanConstants.LOANOFFERING, loanOffering, request);
SessionUtils.setCollectionAttribute(MasterConstants.BUSINESS_ACTIVITIES, multipleLoanDetails.getAllLoanPruposes(), request);
SessionUtils.setAttribute(CustomerConstants.PENDING_APPROVAL_DEFINED, multipleLoanDetails.isLoanPendingApprovalStateEnabled(), request);
return mapping.findForward(ActionForwards.get_success.toString());
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class LoanPrdAction method manage.
@TransactionDemarcate(joinToken = true)
public ActionForward manage(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
LoanPrdActionForm loanPrdActionForm = (LoanPrdActionForm) form;
logger.debug("start manage of Loan Product Action " + loanPrdActionForm.getPrdOfferingId());
Short prdOfferingId = loanPrdActionForm.getPrdOfferingIdValue();
loanPrdActionForm.clear();
LoanOfferingBO loanOffering = getLoanOffering(prdOfferingId);
loadMasterData(request);
loadSelectedFeesPenaltiesAndFunds(getFeesSelected(request, loanOffering), getFundsSelected(loanOffering), getPenaltiesSelected(loanOffering), request);
loadStatusList(request);
setDataIntoActionForm(loanOffering, loanPrdActionForm, request);
setSelectedQuestionGroupsOnSession(request, loanOffering, getQuestionnaireServiceFacade(request));
setCurrencyOnSession(request, loanOffering);
setRepaymentIndepOfMeetingEnabledFlag(request);
request.setAttribute("GlNamesMode", AccountingRules.getGlNamesMode());
logger.debug("manage of Loan Product Action called" + prdOfferingId);
return mapping.findForward(ActionForwards.manage_success.toString());
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class LoanPrdAction method create.
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("start create method of Loan Product Action");
LoanPrdActionForm loanPrdActionForm = (LoanPrdActionForm) form;
UserContext userContext = getUserContext(request);
Locale locale = getLocale(userContext);
LoanOfferingBO loanOffering = new LoanOfferingBO(userContext, loanPrdActionForm.getPrdOfferingName(), loanPrdActionForm.getPrdOfferingShortName(), getProductCategory(((List<ProductCategoryBO>) SessionUtils.getAttribute(ProductDefinitionConstants.LOANPRODUCTCATEGORYLIST, request)), loanPrdActionForm.getPrdCategoryValue()), (PrdApplicableMasterEntity) findMasterEntity(request, ProductDefinitionConstants.LOANAPPLFORLIST, loanPrdActionForm.getPrdApplicableMasterEnum().getValue()), loanPrdActionForm.getStartDateValue(locale), loanPrdActionForm.getEndDateValue(locale), loanPrdActionForm.getDescription(), (GracePeriodTypeEntity) findMasterEntity(request, ProductDefinitionConstants.LOANGRACEPERIODTYPELIST, loanPrdActionForm.getGracePeriodTypeValue()), loanPrdActionForm.getGracePeriodDurationValue(), (InterestTypesEntity) findMasterEntity(request, ProductDefinitionConstants.INTERESTTYPESLIST, loanPrdActionForm.getInterestTypesValue()), loanPrdActionForm.getMaxInterestRateValue(), loanPrdActionForm.getMinInterestRateValue(), loanPrdActionForm.getDefInterestRateValue(), loanPrdActionForm.isLoanCounterValue(), loanPrdActionForm.isIntDedAtDisbValue(), loanPrdActionForm.isPrinDueLastInstValue(), getFundsFromList((List<FundBO>) SessionUtils.getAttribute(ProductDefinitionConstants.SRCFUNDSLIST, request), loanPrdActionForm.getLoanOfferingFunds()), getFeeList((List<FeeBO>) SessionUtils.getAttribute(ProductDefinitionConstants.LOANPRDFEE, request), loanPrdActionForm.getPrdOfferinFees()), getPenaltyList((List<PenaltyBO>) SessionUtils.getAttribute(ProductDefinitionConstants.LOANPRDPENALTY, request), loanPrdActionForm.getPrdOfferinPenalties()), new MeetingBO(RecurrenceType.fromInt(loanPrdActionForm.getFreqOfInstallmentsValue()), loanPrdActionForm.getRecurAfterValue(), loanPrdActionForm.getStartDateValue(locale), MeetingType.LOAN_INSTALLMENT), findGLCodeEntity(request, ProductDefinitionConstants.LOANPRICIPALGLCODELIST, loanPrdActionForm.getPrincipalGLCode()), findGLCodeEntity(request, ProductDefinitionConstants.LOANINTERESTGLCODELIST, loanPrdActionForm.getInterestGLCode()), loanPrdActionForm, loanPrdActionForm.shouldWaiverInterest());
loanOffering.setQuestionGroups(getQuestionGroups(request));
loanOffering.setCurrency(getCurrency(loanPrdActionForm.getCurrencyId()));
loanOffering.setRoundingDifferenceInFirstPayment(loanPrdActionForm.isRoundingDifferenceInFirstPayment());
mapCashFlowDetail(loanPrdActionForm, loanOffering);
mapVariableInstallmentDetails(loanOffering, loanPrdActionForm);
loanOffering.setFixedRepaymentSchedule(loanPrdActionForm.isFixedRepaymentSchedule());
loanOffering.save();
request.setAttribute(ProductDefinitionConstants.LOANPRODUCTID, loanOffering.getPrdOfferingId());
request.setAttribute(ProductDefinitionConstants.LOANPRDGLOBALOFFERINGNUM, loanOffering.getGlobalPrdOfferingNum());
return mapping.findForward(ActionForwards.create_success.toString());
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class AccountRegenerateScheduleIntegrationTestCase method createLoanAccount.
public LoanBO createLoanAccount(MeetingBO customerMeeting, MeetingBO loanMeeting) {
center = TestObjectFactory.createWeeklyFeeCenter("Center", customerMeeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering("Loan", ApplicableTo.GROUPS, new DateTime().toDate(), PrdStatus.LOAN_ACTIVE, 300.0, 1.2, (short) 3, InterestType.FLAT, loanMeeting);
return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, new DateTime().toDate(), loanOffering);
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class AccountFeesActionDetailEntityIntegrationTest method getLoanAccount.
private AccountBO getLoanAccount() {
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering("Loan", ApplicableTo.GROUPS, new Date(System.currentTimeMillis()), PrdStatus.LOAN_ACTIVE, 300.0, 1.2, 3, InterestType.FLAT, meeting);
return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, new Date(System.currentTimeMillis()), loanOffering);
}
Aggregations