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