use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestDocument method doActionTaken.
public void doActionTaken(ActionTakenEvent event) {
super.doActionTaken(event);
WorkflowDocument workflowDocument = getDocumentHeader().getWorkflowDocument();
String currentNode = null;
Set<String> currentNodes = workflowDocument.getCurrentNodeNames();
if (CollectionUtils.isNotEmpty(currentNodes)) {
Object[] names = currentNodes.toArray();
if (names.length > 0) {
currentNode = (String) names[0];
}
}
// everything in the below list requires correcting entries to be written to the GL
if (PaymentRequestStatuses.getNodesRequiringCorrectingGeneralLedgerEntries().contains(currentNode)) {
// KFSPTS-2598 : Treasury also can 'calculate'
if (PurapConstants.PaymentRequestStatuses.NODE_ACCOUNT_REVIEW.equals(currentNode) || PurapConstants.PaymentRequestStatuses.NODE_VENDOR_TAX_REVIEW.equals(currentNode) || PurapConstants.PaymentRequestStatuses.NODE_PAYMENT_METHOD_REVIEW.equals(currentNode)) {
SpringContext.getBean(PurapGeneralLedgerService.class).generateEntriesModifyPaymentRequest(this);
}
}
}
use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CuRequisitionDocumentPresentationController method getEditModes.
public Set<String> getEditModes(Document document) {
Set<String> editModes = super.getEditModes(document);
RequisitionDocument reqDocument = (RequisitionDocument) document;
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
if (workflowDocument.isEnroute()) {
Set<String> nodeNames = workflowDocument.getNodeNames();
for (Iterator<String> iterator = nodeNames.iterator(); iterator.hasNext(); ) {
String nodeNamesNode = iterator.next();
if (RequisitionStatuses.NODE_ACCOUNT.equals(nodeNamesNode)) {
// KFSPTS-1792 : Should check whetehr object code is capital asset code ?
editModes.add(CURequisitionEditMode.ENABLE_CAPITAL_ASSET);
}
}
if (SpringContext.getBean(CuPurapAccountingService.class).isFiscalOfficersForAllAcctLines(reqDocument)) {
editModes.remove(RequisitionEditMode.DISABLE_SETUP_ACCT_DISTRIBUTION);
editModes.remove(RequisitionEditMode.DISABLE_REMOVE_ACCTS);
editModes.add(RequisitionEditMode.ENABLE_COMMODITY_CODE);
}
}
if (document instanceof RequisitionDocument && !editModes.contains(RequisitionEditMode.DISABLE_SETUP_ACCT_DISTRIBUTION) && !hasEmptyAcctline((RequisitionDocument) document)) {
editModes.add(RequisitionEditMode.DISABLE_SETUP_ACCT_DISTRIBUTION);
}
return editModes;
}
use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class IWantDocumentPresentationController method canEditDocumentOverview.
/*
* CU Customization (KFSPTS-2270): Added the ability to edit the document overview/description
* for enroute IWNT docs; we'll use KIM permissions to restrict this to select users.
*
* We restrict the editing of the doc overview to IWNT docs in enroute status at the
* OrganizationHierarchy node, and further restrict it to non-ad-hoc users.
*/
@Override
public boolean canEditDocumentOverview(Document document) {
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
Set<String> nodeNames = workflowDocument.getCurrentNodeNames();
return workflowDocument.isEnroute() && CollectionUtils.isNotEmpty(nodeNames) && nodeNames.contains("OrganizationHierarchy") && !SpringContext.getBean(FinancialSystemWorkflowHelperService.class).isAdhocApprovalRequestedForPrincipal(workflowDocument, GlobalVariables.getUserSession().getPrincipalId());
}
use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class IWantDocumentPresentationController method getEditModes.
@Override
public Set<String> getEditModes(Document document) {
Set<String> editModes = super.getEditModes(document);
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
IWantDocument iWantDocument = (IWantDocument) document;
if (SpringContext.getBean(FinancialSystemWorkflowHelperService.class).isAdhocApprovalRequestedForPrincipal(workflowDocument, GlobalVariables.getUserSession().getPrincipalId())) {
editModes.add("completeOrder");
}
if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
editModes.add("wizard");
}
if (CUPurapConstants.IWantDocumentSteps.CUSTOMER_DATA_STEP.equalsIgnoreCase(iWantDocument.getStep())) {
editModes.add(CUPurapConstants.IWantDocumentSteps.CUSTOMER_DATA_STEP);
// remove all others
editModes.remove(CUPurapConstants.IWantDocumentSteps.ITEMS_AND_ACCT_DATA_STEP);
editModes.remove(CUPurapConstants.IWantDocumentSteps.VENDOR_STEP);
editModes.remove(CUPurapConstants.IWantDocumentSteps.ROUTING_STEP);
}
if (CUPurapConstants.IWantDocumentSteps.ITEMS_AND_ACCT_DATA_STEP.equalsIgnoreCase(iWantDocument.getStep())) {
editModes.add(CUPurapConstants.IWantDocumentSteps.ITEMS_AND_ACCT_DATA_STEP);
// remove all others
editModes.remove(CUPurapConstants.IWantDocumentSteps.CUSTOMER_DATA_STEP);
editModes.remove(CUPurapConstants.IWantDocumentSteps.VENDOR_STEP);
editModes.remove(CUPurapConstants.IWantDocumentSteps.ROUTING_STEP);
}
if (CUPurapConstants.IWantDocumentSteps.VENDOR_STEP.equalsIgnoreCase(iWantDocument.getStep())) {
editModes.add(CUPurapConstants.IWantDocumentSteps.VENDOR_STEP);
// remove all others
editModes.remove(CUPurapConstants.IWantDocumentSteps.CUSTOMER_DATA_STEP);
editModes.remove(CUPurapConstants.IWantDocumentSteps.ITEMS_AND_ACCT_DATA_STEP);
editModes.remove(CUPurapConstants.IWantDocumentSteps.ROUTING_STEP);
}
if (CUPurapConstants.IWantDocumentSteps.ROUTING_STEP.equalsIgnoreCase(iWantDocument.getStep())) {
editModes.add(CUPurapConstants.IWantDocumentSteps.ROUTING_STEP);
// remove all others
editModes.remove(CUPurapConstants.IWantDocumentSteps.CUSTOMER_DATA_STEP);
editModes.remove(CUPurapConstants.IWantDocumentSteps.ITEMS_AND_ACCT_DATA_STEP);
editModes.remove(CUPurapConstants.IWantDocumentSteps.VENDOR_STEP);
}
// KFSPTS-2527 only display create req and create DV buttons if neither REQ not DV has been created from I Want doc
if ((StringUtils.isBlank(iWantDocument.getReqsDocId()) && StringUtils.isBlank(iWantDocument.getDvDocId())) && !workflowDocument.isInitiated() && !workflowDocument.isSaved()) {
editModes.add(CUPurapConstants.IWNT_DOC_CREATE_REQ);
editModes.add(CUPurapConstants.IWNT_DOC_CREATE_DV);
}
editModes.add(CUPurapConstants.IWNT_DOC_USE_LOOKUPS);
return editModes;
}
use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class PurchaseOrderDocumentPresentationController method getEditModes.
@Override
public Set<String> getEditModes(Document document) {
Set<String> editModes = super.getEditModes(document);
PurchaseOrderDocument poDocument = (PurchaseOrderDocument) document;
WorkflowDocument workflowDocument = poDocument.getFinancialSystemDocumentHeader().getWorkflowDocument();
String statusCode = poDocument.getApplicationDocumentStatus();
editModes.add(PurchaseOrderEditMode.ASSIGN_SENSITIVE_DATA);
// if the ENABLE_COMMODITY_CODE_IND system parameter is Y then add this edit mode so that the commodity code fields would display on the document.
boolean enableCommodityCode = SpringContext.getBean(ParameterService.class).getParameterValueAsBoolean(KfsParameterConstants.PURCHASING_DOCUMENT.class, PurapParameterConstants.ENABLE_COMMODITY_CODE_IND);
if (enableCommodityCode) {
editModes.add(PurchaseOrderEditMode.ENABLE_COMMODITY_CODE);
}
if (canFirstTransmitPrintPo(poDocument)) {
editModes.add(PurchaseOrderEditMode.PRINT_PURCHASE_ORDER);
}
if (canPreviewPrintPo(poDocument)) {
editModes.add(PurchaseOrderEditMode.PREVIEW_PRINT_PURCHASE_ORDER);
}
if (canResendCxml(poDocument)) {
editModes.add(PurchaseOrderEditMode.RESEND_PURCHASE_ORDER);
}
// if vendor has been selected from DB, certain vendor fields are not allowed to be edited
if (ObjectUtils.isNotNull(poDocument.getVendorHeaderGeneratedIdentifier())) {
editModes.add(PurchaseOrderEditMode.LOCK_VENDOR_ENTRY);
}
// if B2B purchase order, certain fields are not allowed to be edited
if (RequisitionSources.B2B.equals(poDocument.getRequisitionSourceCode())) {
editModes.add(PurchaseOrderEditMode.LOCK_B2B_ENTRY);
}
// if not B2B requisition, users can edit the posting year if within a given amount of time set in a parameter
if (!RequisitionSources.B2B.equals(poDocument.getRequisitionSourceCode()) && SpringContext.getBean(PurapService.class).allowEncumberNextFiscalYear() && (PurchaseOrderStatuses.APPDOC_IN_PROCESS.equals(statusCode) || PurchaseOrderStatuses.APPDOC_WAITING_FOR_VENDOR.equals(statusCode) || PurchaseOrderStatuses.APPDOC_WAITING_FOR_DEPARTMENT.equals(statusCode) || PurchaseOrderStatuses.APPDOC_QUOTE.equals(statusCode) || PurchaseOrderStatuses.APPDOC_AWAIT_PURCHASING_REVIEW.equals(statusCode))) {
editModes.add(PurchaseOrderEditMode.ALLOW_POSTING_YEAR_ENTRY);
}
// check if purap tax is enabled
boolean salesTaxInd = SpringContext.getBean(ParameterService.class).getParameterValueAsBoolean(KfsParameterConstants.PURCHASING_DOCUMENT.class, PurapParameterConstants.ENABLE_SALES_TAX_IND);
if (salesTaxInd) {
editModes.add(PurapAuthorizationConstants.PURAP_TAX_ENABLED);
if (poDocument.isUseTaxIndicator()) {
// if use tax, don't allow editing of tax fields
editModes.add(PurchaseOrderEditMode.LOCK_TAX_AMOUNT_ENTRY);
} else {
// display the "clear all taxes" button if doc is not using use tax
editModes.add(PurchaseOrderEditMode.CLEAR_ALL_TAXES);
}
}
// set display mode for Receiving Address section according to parameter value
boolean displayReceivingAddress = SpringContext.getBean(ParameterService.class).getParameterValueAsBoolean(KfsParameterConstants.PURCHASING_DOCUMENT.class, PurapParameterConstants.ENABLE_RECEIVING_ADDRESS_IND);
if (displayReceivingAddress) {
editModes.add(PurchaseOrderEditMode.DISPLAY_RECEIVING_ADDRESS);
}
// if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
if (PurchaseOrderStatuses.APPDOC_IN_PROCESS.equals(statusCode) || PurchaseOrderStatuses.APPDOC_WAITING_FOR_VENDOR.equals(statusCode) || PurchaseOrderStatuses.APPDOC_WAITING_FOR_DEPARTMENT.equals(statusCode) || PurchaseOrderStatuses.APPDOC_QUOTE.equals(statusCode)) {
editModes.add(PurchaseOrderEditMode.PRE_ROUTE_CHANGEABLE);
}
// INTERNAL PURCHASING ROUTE LEVEL - Approvers can edit full detail on Purchase Order except they cannot change the CHART/ORG.
if (poDocument.isDocumentStoppedInRouteNode(PurapConstants.PurchaseOrderStatuses.NODE_CONTRACT_MANAGEMENT)) {
editModes.add(PurchaseOrderEditMode.LOCK_INTERNAL_PURCHASING_ENTRY);
}
// Set display mode for Split PO.
if (poDocument.isPendingSplit()) {
editModes.add(PurchaseOrderEditMode.SPLITTING_ITEM_SELECTION);
}
// KFSPTS-985, KFSUPGRADE-75
if (document instanceof PurchaseOrderDocument && !editModes.contains(RequisitionEditMode.DISABLE_SETUP_ACCT_DISTRIBUTION) && !hasEmptyAcctline((PurchaseOrderDocument) document)) {
editModes.add(RequisitionEditMode.DISABLE_SETUP_ACCT_DISTRIBUTION);
}
return editModes;
}
Aggregations