Search in sources :

Example 16 with ActionForward

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

the class KualiAccountingDocumentActionBase method route.

@Override
public ActionForward route(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    KualiAccountingDocumentFormBase tmpForm = (KualiAccountingDocumentFormBase) form;
    // this.applyCapitalAssetInformation(tmpForm);
    ActionForward forward = super.route(mapping, form, request, response);
    checkSalesTaxRequiredAllLines(tmpForm, tmpForm.getFinancialDocument().getSourceAccountingLines());
    checkSalesTaxRequiredAllLines(tmpForm, tmpForm.getFinancialDocument().getTargetAccountingLines());
    return forward;
}
Also used : ActionForward(org.apache.struts.action.ActionForward) AccountingLineOverride(org.kuali.kfs.sys.businessobject.AccountingLineOverride)

Example 17 with ActionForward

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

the class KualiAccountingDocumentActionBase method execute.

/**
 * Adds check for accountingLine updates, generates and dispatches any events caused by such updates
 *
 * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm,
 *      javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 */
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    KualiAccountingDocumentFormBase transForm = (KualiAccountingDocumentFormBase) form;
    // handle changes to accountingLines
    if (transForm.hasDocumentId()) {
        AccountingDocument financialDocument = (AccountingDocument) transForm.getDocument();
        processAccountingLines(financialDocument, transForm, KFSConstants.SOURCE);
        processAccountingLines(financialDocument, transForm, KFSConstants.TARGET);
    }
    // This is after a potential handleUpdate(), to display automatically cleared overrides following a route or save.
    processAccountingLineOverrides(transForm);
    // proceed as usual
    ActionForward result = super.execute(mapping, form, request, response);
    return result;
}
Also used : AccountingDocument(org.kuali.kfs.sys.document.AccountingDocument) ActionForward(org.apache.struts.action.ActionForward) AccountingLineOverride(org.kuali.kfs.sys.businessobject.AccountingLineOverride)

Example 18 with ActionForward

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

the class KualiAccountingDocumentActionBase method blanketApprove.

@Override
public ActionForward blanketApprove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    KualiAccountingDocumentFormBase tmpForm = (KualiAccountingDocumentFormBase) form;
    checkSalesTaxRequiredAllLines(tmpForm, tmpForm.getFinancialDocument().getSourceAccountingLines());
    checkSalesTaxRequiredAllLines(tmpForm, tmpForm.getFinancialDocument().getTargetAccountingLines());
    ActionForward forward = super.blanketApprove(mapping, form, request, response);
    return forward;
}
Also used : ActionForward(org.apache.struts.action.ActionForward) AccountingLineOverride(org.kuali.kfs.sys.businessobject.AccountingLineOverride)

Example 19 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 20 with ActionForward

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

the class CuDisbursementVoucherAction method save.

/**
 * Overridden to also perform address change notifications if the document is enroute.
 *
 * @see org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase#save()
 */
@SuppressWarnings("deprecation")
@Override
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    CuDisbursementVoucherForm dvForm = (CuDisbursementVoucherForm) form;
    ActionForward forward;
    // If the document is ENROUTE, then also send address change notifications as needed.
    if (dvForm.getFinancialDocument().getDocumentHeader().getWorkflowDocument().isEnroute()) {
        boolean passed = SpringContext.getBean(KualiRuleService.class).applyRules(new SaveDocumentEvent(dvForm.getFinancialDocument()));
        if (passed) {
            SpringContext.getBean(DisbursementVoucherPayeeServiceImpl.class).checkPayeeAddressForChanges((CuDisbursementVoucherDocument) dvForm.getFinancialDocument());
        }
        forward = super.save(mapping, form, request, response);
        if (passed && CollectionUtils.isNotEmpty(dvForm.getFinancialDocument().getAdHocRoutePersons()) && GlobalVariables.getMessageMap().hasNoErrors()) {
            sendAdHocRequests(mapping, form, request, response);
        }
    } else {
        // If the document is not ENROUTE, then just proceed as in the superclass.
        forward = super.save(mapping, form, request, response);
    }
    return forward;
}
Also used : KualiRuleService(org.kuali.kfs.krad.service.KualiRuleService) DisbursementVoucherPayeeServiceImpl(org.kuali.kfs.fp.document.service.impl.DisbursementVoucherPayeeServiceImpl) SaveDocumentEvent(org.kuali.kfs.krad.rules.rule.event.SaveDocumentEvent) ActionForward(org.apache.struts.action.ActionForward)

Aggregations

ActionForward (org.apache.struts.action.ActionForward)117 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 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 Cookie (javax.servlet.http.Cookie)5 ActionMapping (org.apache.struts.action.ActionMapping)5 CloseSession (org.mifos.framework.util.helpers.CloseSession)5 Submission (cn.edu.zju.acm.onlinejudge.bean.Submission)4 IWantDocumentService (edu.cornell.kfs.module.purap.document.service.IWantDocumentService)4