Search in sources :

Example 51 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class AccountAppAction method removePenalties.

@CloseSession
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward removePenalties(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    Integer accountId = getIntegerValue(request.getParameter("accountId"));
    Short penaltyId = getShortValue(request.getParameter("penaltyId"));
    AccountBO accountBO = getAccountBusinessService().getAccount(accountId);
    SessionUtils.setAttribute(Constants.BUSINESS_KEY, accountBO, request);
    if (accountBO instanceof LoanBO) {
        this.loanAccountServiceFacade.removeLoanPenalty(accountId, penaltyId);
    }
    String fromPage = request.getParameter(CenterConstants.FROM_PAGE);
    StringBuilder forward = new StringBuilder();
    forward = forward.append(AccountConstants.REMOVE + "_" + fromPage + "_" + AccountConstants.CHARGES);
    if (fromPage != null) {
        return mapping.findForward(forward.toString());
    }
    return mapping.findForward(AccountConstants.REMOVE_SUCCESS);
}
Also used : AccountBO(org.mifos.accounts.business.AccountBO) LoanBO(org.mifos.accounts.loan.business.LoanBO) CloseSession(org.mifos.framework.util.helpers.CloseSession) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 52 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class AccountApplyGroupIndividualAction method validate.

@TransactionDemarcate(joinToken = true)
public ActionForward validate(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    String method = (String) request.getAttribute("methodCalled");
    String forward = null;
    //workaround for checkbox problem
    AccountApplyPaymentActionForm accountApplyPaymentActionForm = (AccountApplyPaymentActionForm) form;
    accountApplyPaymentActionForm.setTruePrintReceipt(accountApplyPaymentActionForm.getPrintReceipt());
    accountApplyPaymentActionForm.setPrintReceipt(false);
    if (method != null) {
        forward = method + "_failure";
    }
    return mapping.findForward(forward);
}
Also used : AccountApplyPaymentActionForm(org.mifos.accounts.struts.actionforms.AccountApplyPaymentActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 53 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class SavingsAction method getRecentActivity.

@TransactionDemarcate(joinToken = true)
public ActionForward getRecentActivity(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("In SavingsAction::getRecentActivity()");
    SavingsBO savings = (SavingsBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    Long savingsId = savings.getAccountId().longValue();
    List<SavingsRecentActivityDto> recentActivity = this.savingsServiceFacade.retrieveRecentSavingsActivities(savingsId);
    SessionUtils.setCollectionAttribute(SavingsConstants.RECENTY_ACTIVITY_LIST, recentActivity, request);
    return mapping.findForward("getRecentActivity_success");
}
Also used : SavingsRecentActivityDto(org.mifos.dto.screen.SavingsRecentActivityDto) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 54 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class SavingsAction method edit.

@TransactionDemarcate(joinToken = true)
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("In SavingsAction::edit()");
    SavingsBO savings = (SavingsBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    SavingsActionForm actionForm = (SavingsActionForm) form;
    List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>();
    actionForm.setRecommendedAmount(savings.getRecommendedAmount().toString());
    actionForm.setAccountCustomFieldSet(customFields);
    List<CustomFieldDefinitionEntity> customFieldDefinitions = new ArrayList<CustomFieldDefinitionEntity>();
    SessionUtils.setCollectionAttribute(SavingsConstants.CUSTOM_FIELDS, customFieldDefinitions, request);
    return mapping.findForward("edit_success");
}
Also used : SavingsActionForm(org.mifos.accounts.savings.struts.actionforms.SavingsActionForm) CustomFieldDto(org.mifos.dto.domain.CustomFieldDto) ArrayList(java.util.ArrayList) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) CustomFieldDefinitionEntity(org.mifos.application.master.business.CustomFieldDefinitionEntity) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 55 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class SavingsAction method waiveAmountOverDue.

@TransactionDemarcate(joinToken = true)
public ActionForward waiveAmountOverDue(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("In SavingsAction::waiveAmountOverDue()");
    UserContext uc = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
    SavingsBO savings = (SavingsBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    Integer versionNum = savings.getVersionNo();
    savings = this.savingsDao.findBySystemId(((SavingsActionForm) form).getGlobalAccountNum());
    checkVersionMismatch(versionNum, savings.getVersionNo());
    savings.setUserContext(uc);
    Long savingsId = savings.getAccountId().longValue();
    this.savingsServiceFacade.waiveDepositAmountOverDue(savingsId);
    return mapping.findForward("waiveAmount_success");
}
Also used : SavingsActionForm(org.mifos.accounts.savings.struts.actionforms.SavingsActionForm) UserContext(org.mifos.security.util.UserContext) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) 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