Search in sources :

Example 56 with TransactionDemarcate

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");
}
Also used : SavingsStatusChangeHistoryDto(org.mifos.dto.domain.SavingsStatusChangeHistoryDto) ArrayList(java.util.ArrayList) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) AccountStatusChangeHistoryEntity(org.mifos.accounts.business.AccountStatusChangeHistoryEntity) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 57 with TransactionDemarcate

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);
}
Also used : SavingsActionForm(org.mifos.accounts.savings.struts.actionforms.SavingsActionForm) CustomerBO(org.mifos.customers.business.CustomerBO) PrdOfferingDto(org.mifos.dto.domain.PrdOfferingDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 58 with TransactionDemarcate

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");
}
Also used : SavingsActionForm(org.mifos.accounts.savings.struts.actionforms.SavingsActionForm) AccountActionDateEntity(org.mifos.accounts.business.AccountActionDateEntity) AccountFlagMapping(org.mifos.accounts.business.AccountFlagMapping) UserContext(org.mifos.security.util.UserContext) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) SavingsAccountDepositDueDto(org.mifos.dto.screen.SavingsAccountDepositDueDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 59 with TransactionDemarcate

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");
}
Also used : InterestCalcTypeEntity(org.mifos.accounts.productdefinition.business.InterestCalcTypeEntity) UserContext(org.mifos.security.util.UserContext) CustomFieldDto(org.mifos.dto.domain.CustomFieldDto) ArrayList(java.util.ArrayList) SavingsProductReferenceDto(org.mifos.dto.screen.SavingsProductReferenceDto) RecommendedAmntUnitEntity(org.mifos.accounts.productdefinition.business.RecommendedAmntUnitEntity) CustomFieldDefinitionEntity(org.mifos.application.master.business.CustomFieldDefinitionEntity) SavingsActionForm(org.mifos.accounts.savings.struts.actionforms.SavingsActionForm) SavingsTypeEntity(org.mifos.accounts.productdefinition.business.SavingsTypeEntity) SavingsOfferingBO(org.mifos.accounts.productdefinition.business.SavingsOfferingBO) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 60 with TransactionDemarcate

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);
}
Also used : SavingsActionForm(org.mifos.accounts.savings.struts.actionforms.SavingsActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)259 UserContext (org.mifos.security.util.UserContext)72 ArrayList (java.util.ArrayList)41 CloseSession (org.mifos.framework.util.helpers.CloseSession)35 LoanBO (org.mifos.accounts.loan.business.LoanBO)26 ClientCustActionForm (org.mifos.customers.client.struts.actionforms.ClientCustActionForm)21 CustomerBO (org.mifos.customers.business.CustomerBO)20 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)19 AccountBO (org.mifos.accounts.business.AccountBO)18 ApplicationException (org.mifos.framework.exceptions.ApplicationException)17 ActionErrors (org.apache.struts.action.ActionErrors)14 LocalDate (org.joda.time.LocalDate)14 AccountApplyPaymentActionForm (org.mifos.accounts.struts.actionforms.AccountApplyPaymentActionForm)14 ClientBO (org.mifos.customers.client.business.ClientBO)14 CustomFieldDto (org.mifos.dto.domain.CustomFieldDto)13 List (java.util.List)12 AccountPaymentEntity (org.mifos.accounts.business.AccountPaymentEntity)12 CustomFieldDefinitionEntity (org.mifos.application.master.business.CustomFieldDefinitionEntity)12 MeetingBO (org.mifos.application.meeting.business.MeetingBO)12 ActionForward (org.apache.struts.action.ActionForward)11