Search in sources :

Example 26 with IWantDocument

use of edu.cornell.kfs.module.purap.document.IWantDocument in project cu-kfs by CU-CommunityApps.

the class IWantDocumentAction method addItem.

/**
 * Adds an item to the document
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return
 * @throws Exception
 */
public ActionForward addItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    IWantDocumentForm iWantDocumentForm = (IWantDocumentForm) form;
    IWantDocument iWantDocument = (IWantDocument) iWantDocumentForm.getDocument();
    IWantItem item = iWantDocumentForm.getNewIWantItemLine();
    addNewItem(iWantDocumentForm, iWantDocument, item);
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Also used : IWantItem(edu.cornell.kfs.module.purap.businessobject.IWantItem) IWantDocument(edu.cornell.kfs.module.purap.document.IWantDocument) PurApFavoriteAccountLineBuilderForIWantDocument(edu.cornell.kfs.module.purap.util.PurApFavoriteAccountLineBuilderForIWantDocument)

Example 27 with IWantDocument

use of edu.cornell.kfs.module.purap.document.IWantDocument in project cu-kfs by CU-CommunityApps.

the class IWantDocumentRule method processCustomRouteDocumentBusinessRules.

@Override
protected boolean processCustomRouteDocumentBusinessRules(Document document) {
    boolean valid = super.processCustomRouteDocumentBusinessRules(document);
    IWantDocument iWantDocument = (IWantDocument) document;
    if (SpringContext.getBean(FinancialSystemWorkflowHelperService.class).isAdhocApprovalRequestedForPrincipal(document.getDocumentHeader().getWorkflowDocument(), GlobalVariables.getUserSession().getPrincipalId())) {
        // validate that Complete order option was selected
        if (StringUtils.isBlank(iWantDocument.getCompleteOption())) {
            GlobalVariables.getMessageMap().putError("document.completeOption", CUPurapKeyConstants.ERROR_IWNT_CONMPLETE_ORDER_OPTION_REQUIRED);
        }
    }
    return valid;
}
Also used : FinancialSystemWorkflowHelperService(org.kuali.kfs.sys.service.FinancialSystemWorkflowHelperService) IWantDocument(edu.cornell.kfs.module.purap.document.IWantDocument)

Aggregations

IWantDocument (edu.cornell.kfs.module.purap.document.IWantDocument)27 PurApFavoriteAccountLineBuilderForIWantDocument (edu.cornell.kfs.module.purap.util.PurApFavoriteAccountLineBuilderForIWantDocument)18 IWantDocumentService (edu.cornell.kfs.module.purap.document.service.IWantDocumentService)8 ActionForward (org.apache.struts.action.ActionForward)7 IWantAccount (edu.cornell.kfs.module.purap.businessobject.IWantAccount)4 IWantItem (edu.cornell.kfs.module.purap.businessobject.IWantItem)4 HashMap (java.util.HashMap)3 RouteDocumentEvent (org.kuali.kfs.krad.rules.rule.event.RouteDocumentEvent)3 KualiRuleService (org.kuali.kfs.krad.service.KualiRuleService)3 WorkflowDocument (org.kuali.rice.kew.api.WorkflowDocument)3 Person (org.kuali.rice.kim.api.identity.Person)3 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)2 LevelOrganization (edu.cornell.kfs.module.purap.businessobject.LevelOrganization)2 KualiDocumentFormBase (org.kuali.kfs.kns.web.struts.form.KualiDocumentFormBase)2 RequisitionDocument (org.kuali.kfs.module.purap.document.RequisitionDocument)2 PurapService (org.kuali.kfs.module.purap.document.service.PurapService)2 RequisitionForm (org.kuali.kfs.module.purap.document.web.struts.RequisitionForm)2 FinancialSystemWorkflowHelperService (org.kuali.kfs.sys.service.FinancialSystemWorkflowHelperService)2 VendorPhoneNumber (org.kuali.kfs.vnd.businessobject.VendorPhoneNumber)2 ConcreteKeyValue (org.kuali.rice.core.api.util.ConcreteKeyValue)2