use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.
the class SavingsAction method getStatusHistory.
@TransactionDemarcate(joinToken = true)
public ActionForward getStatusHistory(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In SavingsAction::getRecentActivity()");
String globalAccountNum = request.getParameter("globalAccountNum");
List<SavingsStatusChangeHistoryDto> savingsStatusHistoryDtoList = this.savingsServiceFacade.retrieveStatusChangeHistory(globalAccountNum);
SavingsBO savings = this.savingsDao.findBySystemId(globalAccountNum);
Hibernate.initialize(savings.getAccountStatusChangeHistory());
savings.setUserContext((UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession()));
List<AccountStatusChangeHistoryEntity> savingsStatusHistoryViewList = new ArrayList<AccountStatusChangeHistoryEntity>(savings.getAccountStatusChangeHistory());
SessionUtils.setCollectionAttribute(SavingsConstants.STATUS_CHANGE_HISTORY_LIST, savingsStatusHistoryViewList, request);
return mapping.findForward("getStatusHistory_success");
}
use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.
the class SavingsAction method getPrdOfferings.
@TransactionDemarcate(saveToken = true)
public ActionForward getPrdOfferings(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
SavingsActionForm savingsActionForm = ((SavingsActionForm) form);
doCleanUp(savingsActionForm, request);
Integer customerId = Integer.valueOf(savingsActionForm.getCustomerId());
CustomerBO customer = this.customerDao.findCustomerById(customerId);
SessionUtils.setAttribute(SavingsConstants.CLIENT, customer, request);
List<PrdOfferingDto> savingPrds = this.savingsServiceFacade.retrieveApplicableSavingsProductsForCustomer(customerId);
SessionUtils.setCollectionAttribute(SavingsConstants.SAVINGS_PRD_OFFERINGS, savingPrds, request);
return mapping.findForward(AccountConstants.GET_PRDOFFERINGS_SUCCESS);
}
use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.
the class SavingsAction method getDepositDueDetails.
@TransactionDemarcate(saveToken = true)
public ActionForward getDepositDueDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In SavingsAction::getDepositDueDetails()");
SavingsActionForm actionform = (SavingsActionForm) form;
UserContext uc = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
SessionUtils.removeAttribute(Constants.BUSINESS_KEY, request);
String savingsSystemId = actionform.getGlobalAccountNum();
SavingsBO savings = savingsDao.findBySystemId(savingsSystemId);
for (AccountActionDateEntity actionDate : savings.getAccountActionDates()) {
Hibernate.initialize(actionDate);
}
Hibernate.initialize(savings.getAccountNotes());
for (AccountFlagMapping accountFlagMapping : savings.getAccountFlags()) {
Hibernate.initialize(accountFlagMapping.getFlag());
}
Hibernate.initialize(savings.getAccountFlags());
savings.setUserContext(uc);
SessionUtils.setAttribute(Constants.BUSINESS_KEY, savings, request);
SavingsAccountDepositDueDto depositDueDetails = this.savingsServiceFacade.retrieveDepositDueDetails(savingsSystemId);
return mapping.findForward("depositduedetails_success");
}
use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.
the class SavingsAction method load.
@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
SavingsActionForm savingsActionForm = ((SavingsActionForm) form);
logger.debug(" selectedPrdOfferingId: " + savingsActionForm.getSelectedPrdOfferingId());
UserContext uc = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
List<InterestCalcTypeEntity> interestCalculationTypes = this.savingsProductDao.retrieveInterestCalculationTypes();
SessionUtils.setCollectionAttribute(MasterConstants.INTEREST_CAL_TYPES, interestCalculationTypes, request);
Integer productId = Integer.valueOf(savingsActionForm.getSelectedPrdOfferingId());
SavingsOfferingBO savingsOfferingBO = this.savingsProductDao.findById(productId);
SessionUtils.setAttribute(SavingsConstants.PRDOFFERING, savingsOfferingBO, request);
// NOTE - these details are included in SavingsProductReferenceDto but left as is to satisfy JSP at present
SessionUtils.setCollectionAttribute(MasterConstants.SAVINGS_TYPE, legacyMasterDao.findMasterDataEntitiesWithLocale(SavingsTypeEntity.class), request);
SessionUtils.setCollectionAttribute(MasterConstants.RECOMMENDED_AMOUNT_UNIT, legacyMasterDao.findMasterDataEntitiesWithLocale(RecommendedAmntUnitEntity.class), request);
List<CustomFieldDefinitionEntity> customFieldDefinitions = new ArrayList<CustomFieldDefinitionEntity>();
SessionUtils.setCollectionAttribute(SavingsConstants.CUSTOM_FIELDS, customFieldDefinitions, request);
SavingsProductReferenceDto savingsProductReferenceDto = this.savingsServiceFacade.retrieveSavingsProductReferenceData(productId);
savingsActionForm.setRecommendedAmount(savingsProductReferenceDto.getSavingsProductDetails().getAmountForDeposit().toString());
List<CustomFieldDto> customFields = CustomFieldDefinitionEntity.toDto(customFieldDefinitions, uc.getPreferredLocale());
savingsActionForm.setAccountCustomFieldSet(customFields);
return mapping.findForward("load_success");
}
use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.
the class SavingsAction method preview.
@TransactionDemarcate(joinToken = true)
public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
SavingsActionForm savingActionForm = (SavingsActionForm) form;
SessionUtils.setAttribute(SavingsConstants.IS_PENDING_APPROVAL, ProcessFlowRules.isSavingsPendingApprovalStateEnabled(), request.getSession());
return createGroupQuestionnaire.fetchAppliedQuestions(mapping, savingActionForm, request, ActionForwards.preview_success);
}
Aggregations