Search in sources :

Example 21 with WorkflowDocument

use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.

the class PurchaseOrderDocument method prepareForSave.

// end customPrepareForSave(KualiDocumentEvent)
/**
 * @see org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocumentBase#prepareForSave()
 */
@Override
public void prepareForSave(KualiDocumentEvent event) {
    WorkflowDocument workFlowDocument = this.getFinancialSystemDocumentHeader().getWorkflowDocument();
    String documentType = workFlowDocument.getDocumentTypeName();
    if ((documentType.equals(PurapConstants.PurchaseOrderDocTypes.PURCHASE_ORDER_DOCUMENT)) || (documentType.equals(PurapConstants.PurchaseOrderDocTypes.PURCHASE_ORDER_SPLIT_DOCUMENT))) {
        if (workFlowDocument.isCanceled()) {
            // if doc is FINAL or canceled, saving should not be creating GL entries
            setGeneralLedgerPendingEntries(new ArrayList());
        } else if (workFlowDocument.isFinal()) {
        } else {
            super.prepareForSave(event);
        }
    }
}
Also used : WorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument) ArrayList(java.util.ArrayList)

Example 22 with WorkflowDocument

use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.

the class PurchasingAccountsPayableDocumentBase method isDocumentStoppedInRouteNode.

// for app doc status
@Override
public boolean isDocumentStoppedInRouteNode(String nodeName) {
    WorkflowDocument workflowDocument = this.getFinancialSystemDocumentHeader().getWorkflowDocument();
    Set<String> names = workflowDocument.getCurrentNodeNames();
    if (CollectionUtils.isNotEmpty(names)) {
        List<String> currentRouteLevels = new ArrayList<String>(names);
        for (String routeLevel : currentRouteLevels) {
            if (routeLevel.contains(nodeName) && workflowDocument.isApprovalRequested()) {
                return true;
            }
        }
    }
    return false;
}
Also used : WorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument) ArrayList(java.util.ArrayList)

Example 23 with WorkflowDocument

use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.

the class CuVendorMaintainableImpl method doRouteStatusChange.

@Override
public void doRouteStatusChange(DocumentHeader header) {
    LOG.debug("doRouteStatusChange: entering");
    super.doRouteStatusChange(header);
    VendorDetail vendorDetail = (VendorDetail) getBusinessObject();
    WorkflowDocument workflowDoc = header.getWorkflowDocument();
    if (workflowDoc.isProcessed()) {
        LOG.debug("doRouteStatusChange: workflow is processed");
        this.saveBusinessObject();
        if (recordPvenRouteStatusChangeForPaymentWorksIsEnabled()) {
            performPaymentWorksApprovalProcessingForVendor(vendorDetail, this.getDocumentNumber(), this.getMaintenanceAction());
        }
    } else if (workflowDoc.isDisapproved() || workflowDoc.isCanceled()) {
        LOG.debug("doRouteStatusChange: disapproved or canceled");
        if (recordPvenRouteStatusChangeForPaymentWorksIsEnabled()) {
            performPaymentWorksDisapprovalCancelProcessingForVendor(vendorDetail, this.getDocumentNumber(), this.getMaintenanceAction());
        }
    }
}
Also used : VendorDetail(org.kuali.kfs.vnd.businessobject.VendorDetail) WorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument)

Example 24 with WorkflowDocument

use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.

the class CuAdvanceDepositDocumentAuthorizer method isDocumentStoppedInRouteNode.

/**
 * Determines if document is in org review node for approval.
 *
 * @param nodeName
 * @param accountingDocument
 * @return true if in org review node for approval, false otherwise
 */
public boolean isDocumentStoppedInRouteNode(String nodeName, AccountingDocument accountingDocument) {
    WorkflowDocument workflowDoc = accountingDocument.getDocumentHeader().getWorkflowDocument();
    Set<String> currentRouteLevels = accountingDocument.getDocumentHeader().getWorkflowDocument().getCurrentNodeNames();
    if (currentRouteLevels.contains(nodeName) && workflowDoc.isApprovalRequested()) {
        return true;
    }
    return false;
}
Also used : WorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument)

Example 25 with WorkflowDocument

use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.

the class CuAdvanceDepositDocumentPresentationController method canEdit.

/**
 * @see org.kuali.kfs.kns.document.authorization.DocumentPresentationControllerBase#canEdit(org.kuali.kfs.kns.document.Document)
 */
@Override
public boolean canEdit(Document document) {
    WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
    FinancialSystemDocumentHeader documentheader = (FinancialSystemDocumentHeader) (document.getDocumentHeader());
    if (workflowDocument.isCanceled() || documentheader.getFinancialDocumentInErrorNumber() != null) {
        return false;
    }
    boolean canEdit = false;
    if (workflowDocument.isInitiated() || workflowDocument.isSaved() || workflowDocument.isEnroute() || workflowDocument.isException()) {
        canEdit = true;
    }
    return canEdit;
}
Also used : WorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument) FinancialSystemDocumentHeader(org.kuali.kfs.sys.businessobject.FinancialSystemDocumentHeader)

Aggregations

WorkflowDocument (org.kuali.rice.kew.api.WorkflowDocument)36 ArrayList (java.util.ArrayList)4 FinancialSystemDocumentHeader (org.kuali.kfs.sys.businessobject.FinancialSystemDocumentHeader)4 Person (org.kuali.rice.kim.api.identity.Person)4 IWantDocument (edu.cornell.kfs.module.purap.document.IWantDocument)3 ActionForward (org.apache.struts.action.ActionForward)3 KualiDocumentFormBase (org.kuali.kfs.kns.web.struts.form.KualiDocumentFormBase)3 RequisitionDocument (org.kuali.kfs.module.purap.document.RequisitionDocument)3 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)2 PurApFavoriteAccountLineBuilderForIWantDocument (edu.cornell.kfs.module.purap.util.PurApFavoriteAccountLineBuilderForIWantDocument)2 Iterator (java.util.Iterator)2 List (java.util.List)2 MaintenanceDocument (org.kuali.kfs.kns.document.MaintenanceDocument)2 PurApAccountingLine (org.kuali.kfs.module.purap.businessobject.PurApAccountingLine)2 PurApItem (org.kuali.kfs.module.purap.businessobject.PurApItem)2 PurchaseOrderItem (org.kuali.kfs.module.purap.businessobject.PurchaseOrderItem)2 PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)2 PurchaseOrderDocument (org.kuali.kfs.module.purap.document.PurchaseOrderDocument)2 PurapService (org.kuali.kfs.module.purap.document.service.PurapService)2 FinancialSystemWorkflowHelperService (org.kuali.kfs.sys.service.FinancialSystemWorkflowHelperService)2