Search in sources :

Example 66 with ActionForward

use of org.apache.struts.action.ActionForward in project cu-kfs by CU-CommunityApps.

the class KualiAccountingDocumentActionBase method approve.

@Override
public ActionForward approve(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    KualiAccountingDocumentFormBase tmpForm = (KualiAccountingDocumentFormBase) form;
    // KFSPTS-1735
    ActionForward forward = super.approve(mapping, form, request, response);
    if (GlobalVariables.getMessageMap().hasNoErrors()) {
        // KFSPTS-1735
        SpringContext.getBean(CUFinancialSystemDocumentService.class).checkAccountingLinesForChanges((AccountingDocument) tmpForm.getFinancialDocument());
    // KFSPTS-1735
    }
    // need to check on sales tax for all the accounting lines
    checkSalesTaxRequiredAllLines(tmpForm, tmpForm.getFinancialDocument().getSourceAccountingLines());
    checkSalesTaxRequiredAllLines(tmpForm, tmpForm.getFinancialDocument().getTargetAccountingLines());
    return forward;
}
Also used : CUFinancialSystemDocumentService(edu.cornell.kfs.sys.document.service.CUFinancialSystemDocumentService) ActionForward(org.apache.struts.action.ActionForward) AccountingLineOverride(org.kuali.kfs.sys.businessobject.AccountingLineOverride)

Example 67 with ActionForward

use of org.apache.struts.action.ActionForward in project head by mifos.

the class AccountApplyPaymentAction method applyPayment.

@TransactionDemarcate(validateAndResetToken = true)
@CloseSession
public ActionForward applyPayment(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    UserContext userContext = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
    AccountApplyPaymentActionForm actionForm = (AccountApplyPaymentActionForm) form;
    Integer accountId = Integer.valueOf(actionForm.getAccountId());
    String paymentType = request.getParameter(Constants.INPUT);
    UserReferenceDto userReferenceDto = new UserReferenceDto(userContext.getId());
    AccountPaymentDto accountPaymentDto = accountServiceFacade.getAccountPaymentInformation(accountId, paymentType, userContext.getLocaleId(), userReferenceDto, actionForm.getTrxnDate());
    validateAccountPayment(accountPaymentDto, accountId, request);
    validateAmount(accountPaymentDto, actionForm.getAmount());
    PaymentTypeDto paymentTypeDto;
    String amount = actionForm.getAmount();
    if (accountPaymentDto.getAccountType().equals(AccountTypeDto.LOAN_ACCOUNT)) {
        paymentTypeDto = getLoanPaymentTypeDtoForId(Short.valueOf(actionForm.getPaymentTypeId()));
    } else {
        paymentTypeDto = getFeePaymentTypeDtoForId(Short.valueOf(actionForm.getPaymentTypeId()));
    }
    AccountPaymentParametersDto accountPaymentParametersDto = new AccountPaymentParametersDto(userReferenceDto, new AccountReferenceDto(accountId), new BigDecimal(amount), actionForm.getTrxnDateAsLocalDate(), paymentTypeDto, AccountConstants.NO_COMMENT, actionForm.getReceiptDateAsLocalDate(), actionForm.getReceiptId(), accountPaymentDto.getCustomerDto());
    if (paymentTypeDto.getValue().equals(this.legacyAcceptedPaymentTypeDao.getSavingsTransferId())) {
        this.accountServiceFacade.makePaymentFromSavingsAcc(accountPaymentParametersDto, actionForm.getAccountForTransfer());
    } else {
        this.accountServiceFacade.makePayment(accountPaymentParametersDto);
    }
    request.getSession().setAttribute("globalAccountNum", ((AccountApplyPaymentActionForm) form).getGlobalAccountNum());
    ActionForward findForward;
    if (actionForm.getPrintReceipt()) {
        if (accountPaymentDto.getAccountType().equals(AccountTypeDto.LOAN_ACCOUNT)) {
            findForward = mapping.findForward(getForward("PRINT"));
        } else {
            request.getSession().setAttribute("clientSystemId", accountPaymentDto.getCustomerDto().getGlobalCustNum());
            findForward = mapping.findForward(getForward("PRINT_CLIENT"));
        }
    } else {
        findForward = mapping.findForward(getForward(((AccountApplyPaymentActionForm) form).getInput()));
    }
    return findForward;
}
Also used : UserReferenceDto(org.mifos.dto.domain.UserReferenceDto) UserContext(org.mifos.security.util.UserContext) AccountReferenceDto(org.mifos.dto.domain.AccountReferenceDto) PaymentTypeDto(org.mifos.dto.domain.PaymentTypeDto) AccountPaymentParametersDto(org.mifos.dto.domain.AccountPaymentParametersDto) AccountPaymentDto(org.mifos.accounts.servicefacade.AccountPaymentDto) AccountApplyPaymentActionForm(org.mifos.accounts.struts.actionforms.AccountApplyPaymentActionForm) BigDecimal(java.math.BigDecimal) ActionForward(org.apache.struts.action.ActionForward) CloseSession(org.mifos.framework.util.helpers.CloseSession) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 68 with ActionForward

use of org.apache.struts.action.ActionForward in project head by mifos.

the class CenterCustAction method search.

/**
     * invoked when searching for centers from group creation screen
     */
@Override
@TransactionDemarcate(joinToken = true)
public ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    ActionForward actionForward = super.search(mapping, form, request, response);
    CenterCustActionForm actionForm = (CenterCustActionForm) form;
    String searchString = actionForm.getSearchString();
    CustomerSearch searchResult = this.customerServiceFacade.search(searchString);
    addSeachValues(searchString, searchResult.getOfficeId(), searchResult.getOfficeName(), request);
    SessionUtils.setQueryResultAttribute(Constants.SEARCH_RESULTS, searchResult.getSearchResult(), request);
    return actionForward;
}
Also used : CenterCustActionForm(org.mifos.customers.center.struts.actionforms.CenterCustActionForm) CustomerSearch(org.mifos.application.servicefacade.CustomerSearch) ActionForward(org.apache.struts.action.ActionForward) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 69 with ActionForward

use of org.apache.struts.action.ActionForward in project head by mifos.

the class MeetingAction method edit.

@TransactionDemarcate(conditionToken = true)
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    MeetingActionForm actionForm = (MeetingActionForm) form;
    clearActionForm(actionForm);
    CustomerBO customerInSession = (CustomerBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    CustomerBO customer = this.customerDao.findCustomerById(customerInSession.getCustomerId());
    SessionUtils.setAttribute(Constants.BUSINESS_KEY, customer, request);
    List<WeekDay> workingDays = getLocalizedWorkingDays();
    SessionUtils.setCollectionAttribute(MeetingConstants.WEEKDAYSLIST, workingDays, request);
    SessionUtils.setCollectionAttribute(MeetingConstants.WEEKRANKLIST, RankOfDay.getRankOfDayList(), request);
    ActionForward forward = null;
    if (customer.getCustomerMeeting() != null) {
        MeetingBO meeting = customer.getCustomerMeeting().getMeeting();
        setValuesInActionForm(actionForm, meeting);
        forward = mapping.findForward(ActionForwards.edit_success.toString());
        actionForm.setInput(MeetingConstants.INPUT_EDIT);
    } else {
        actionForm.setInput(MeetingConstants.INPUT_CREATE);
        forward = mapping.findForward(ActionForwards.createMeeting_success.toString());
    }
    return forward;
}
Also used : WeekDay(org.mifos.application.meeting.util.helpers.WeekDay) MeetingBO(org.mifos.application.meeting.business.MeetingBO) CustomerBO(org.mifos.customers.business.CustomerBO) MeetingActionForm(org.mifos.application.meeting.struts.actionforms.MeetingActionForm) ActionForward(org.apache.struts.action.ActionForward) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 70 with ActionForward

use of org.apache.struts.action.ActionForward in project head by mifos.

the class LoanAccountAction method viewAndEditAdditionalInformation.

public ActionForward viewAndEditAdditionalInformation(final ActionMapping mapping, @SuppressWarnings("unused") final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response) throws Exception {
    Integer entityId = Integer.valueOf(request.getParameter("entityId"));
    questionGroupFilter.setLoanOfferingBO(getLoan(entityId).getLoanOffering());
    List<QuestionGroupInstanceDetail> questionGroupInstances = createLoanQuestionnaire.getQuestionGroupInstances(request, entityId);
    request.getSession().setAttribute(LoanConstants.QUESTION_GROUP_INSTANCES, questionGroupInstances);
    ActionForward forward = mapping.findForward(ActionForwards.viewAndEditAdditionalInformation.toString());
    return new ActionForward(forward.getPath(), forward.getRedirect());
}
Also used : ActionForward(org.apache.struts.action.ActionForward) QuestionGroupInstanceDetail(org.mifos.platform.questionnaire.service.QuestionGroupInstanceDetail)

Aggregations

ActionForward (org.apache.struts.action.ActionForward)125 AbstractContest (cn.edu.zju.acm.onlinejudge.bean.AbstractContest)16 ActionMessages (org.apache.struts.action.ActionMessages)14 Problem (cn.edu.zju.acm.onlinejudge.bean.Problem)11 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)11 UserProfile (cn.edu.zju.acm.onlinejudge.bean.UserProfile)9 ActionMessage (org.apache.struts.action.ActionMessage)9 KualiDocumentFormBase (org.kuali.kfs.kns.web.struts.form.KualiDocumentFormBase)8 IWantDocument (edu.cornell.kfs.module.purap.document.IWantDocument)7 PurApFavoriteAccountLineBuilderForIWantDocument (edu.cornell.kfs.module.purap.util.PurApFavoriteAccountLineBuilderForIWantDocument)7 ActionMapping (org.apache.struts.action.ActionMapping)7 UserContext (org.mifos.security.util.UserContext)7 IOException (java.io.IOException)6 Date (java.util.Date)6 AuthorizationPersistence (cn.edu.zju.acm.onlinejudge.persistence.AuthorizationPersistence)5 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 List (java.util.List)5 Cookie (javax.servlet.http.Cookie)5 IWantDocumentService (edu.cornell.kfs.module.purap.document.service.IWantDocumentService)4