use of org.kuali.kfs.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CuProcurementCardDocumentPresentationController method canEditDocumentOverview.
@Override
public boolean canEditDocumentOverview(Document document) {
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
Set<String> nodeNames = workflowDocument.getCurrentNodeNames();
return workflowDocument.isEnroute() && CollectionUtils.isNotEmpty(nodeNames) && nodeNames.contains(KFSConstants.RouteLevelNames.ACCOUNT_REVIEW_FULL_EDIT) && workflowDocument.isApprovalRequested() && !workflowDocument.isAcknowledgeRequested();
}
use of org.kuali.kfs.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CuDisbursementVoucherEmployeeInformationValidation method validate.
public boolean validate(AttributedDocumentEvent event) {
LOG.debug("validate start");
boolean isValid = true;
CuDisbursementVoucherDocument document = (CuDisbursementVoucherDocument) getAccountingDocumentForValidation();
DisbursementVoucherPayeeDetail payeeDetail = document.getDvPayeeDetail();
if (!payeeDetail.isEmployee() || payeeDetail.isVendor() || !(document.getDocumentHeader().getWorkflowDocument().isInitiated() || document.getDocumentHeader().getWorkflowDocument().isSaved())) {
return true;
}
String employeeId = payeeDetail.getDisbVchrPayeeIdNumber();
Person employee = personService.getPersonByEmployeeId(employeeId);
MessageMap errors = GlobalVariables.getMessageMap();
errors.addToErrorPath(KFSPropertyConstants.DOCUMENT);
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
boolean stateIsInitiated = workflowDocument.isInitiated() || workflowDocument.isSaved();
if (ObjectUtils.isNull(employee)) {
employee = personService.getPerson(employeeId);
} else {
if (!KFSConstants.EMPLOYEE_ACTIVE_STATUS.equals(employee.getEmployeeStatusCode()) && !CUKFSConstants.EMPLOYEE_RETIRED_STATUS.equals(employee.getEmployeeStatusCode())) {
// If employee is found, then check that employee is active or retired if the doc has not already been routed.
if (stateIsInitiated) {
String label = dataDictionaryService.getAttributeLabel(DisbursementVoucherPayeeDetail.class, KFSPropertyConstants.DISB_VCHR_PAYEE_ID_NUMBER);
errors.putError(DV_PAYEE_ID_NUMBER_PROPERTY_PATH, KFSKeyConstants.ERROR_INACTIVE, label);
isValid = false;
}
}
}
// check existence of employee
if (employee == null) {
// If employee is not found, report existence error
String label = dataDictionaryService.getAttributeLabel(DisbursementVoucherPayeeDetail.class, KFSPropertyConstants.DISB_VCHR_PAYEE_ID_NUMBER);
errors.putError(DV_PAYEE_ID_NUMBER_PROPERTY_PATH, KFSKeyConstants.ERROR_EXISTENCE, label);
isValid = false;
}
errors.removeFromErrorPath(KFSPropertyConstants.DOCUMENT);
return isValid;
}
use of org.kuali.kfs.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class SecurityGroupMaintainable method doRouteStatusChange.
@Override
public void doRouteStatusChange(DocumentHeader documentHeader) {
super.doRouteStatusChange(documentHeader);
WorkflowDocument workflowDoc = documentHeader.getWorkflowDocument();
if (workflowDoc.isProcessed()) {
SecurityGroup securityGroup = (SecurityGroup) getDataObject();
createSecurityProvisioningEntryIfItDoesNotExist(securityGroup);
}
}
use of org.kuali.kfs.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CuPurchaseOrderAmendmentDocumentPresentationController method getEditModes.
@Override
public Set<String> getEditModes(Document document) {
Set<String> editModes = super.getEditModes(document);
PurchaseOrderDocument poDocument = (PurchaseOrderDocument) document;
if (PurchaseOrderStatuses.APPDOC_CHANGE_IN_PROCESS.equals(poDocument.getApplicationDocumentStatus())) {
WorkflowDocument workflowDocument = poDocument.getFinancialSystemDocumentHeader().getWorkflowDocument();
// amendment doc needs to lock its field for initiator while enroute
if (workflowDocument.isInitiated() || workflowDocument.isSaved() || workflowDocument.isCompletionRequested()) {
editModes.add(PurchaseOrderEditMode.AMENDMENT_ENTRY);
}
}
// KFSUPGRADE-339
if (CUPurapConstants.PurchaseOrderStatuses.APPDOC_AWAITING_FISCAL_REVIEW.equals(((PurchaseOrderDocument) document).getApplicationDocumentStatus())) {
editModes.add(PurchaseOrderEditMode.AMENDMENT_ENTRY);
}
if (getPurapService().isDocumentStoppedInRouteNode((PurchasingAccountsPayableDocument) document, "New Unordered Items")) {
editModes.add(PurchaseOrderEditMode.UNORDERED_ITEM_ACCOUNT_ENTRY);
}
PurchasingAccountsPayableDocument purchasingAccountsPayableDocument = (PurchasingAccountsPayableDocument) document;
List<PurApItem> aboveTheLinePOItems = PurApItemUtils.getAboveTheLineOnly(purchasingAccountsPayableDocument.getItems());
boolean containsUnpaidPaymentRequestsOrCreditMemos = poDocument.getContainsUnpaidPaymentRequestsOrCreditMemos();
for (PurApItem poItem : aboveTheLinePOItems) {
if (!allowAccountingLinesAreEditable((PurchaseOrderItem) poItem, containsUnpaidPaymentRequestsOrCreditMemos)) {
editModes.add(PurchaseOrderEditMode.DISABLE_REMOVE_ACCTS);
break;
}
}
// KFSPTS-985
if (document instanceof PurchaseOrderDocument && !editModes.contains(RequisitionEditMode.DISABLE_SETUP_ACCT_DISTRIBUTION) && !hasEmptyAcctline((PurchaseOrderDocument) document)) {
editModes.add(RequisitionEditMode.DISABLE_SETUP_ACCT_DISTRIBUTION);
}
return editModes;
}
use of org.kuali.kfs.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestDocumentPresentationController method getEditModes.
@Override
public Set<String> getEditModes(Document document) {
Set<String> editModes = super.getEditModes(document);
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
PaymentRequestDocument paymentRequestDocument = (PaymentRequestDocument) document;
if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
// KFSPTS-1891
editModes.add(KfsAuthorizationConstants.TransactionalEditMode.FRN_ENTRY);
editModes.add(KfsAuthorizationConstants.TransactionalEditMode.WIRE_ENTRY);
}
// KFSPTS-1891
if (canApprove(paymentRequestDocument) && canEditAmount(paymentRequestDocument)) {
editModes.add(CUPaymentRequestEditMode.EDIT_AMOUNT);
}
if (paymentRequestDocument.isDocumentStoppedInRouteNode(PaymentRequestStatuses.NODE_PAYMENT_METHOD_REVIEW)) {
editModes.add(CUPaymentRequestEditMode.WAIVE_WIRE_FEE_EDITABLE);
// KFSPTS-1891
editModes.add(KfsAuthorizationConstants.TransactionalEditMode.FRN_ENTRY);
editModes.add(KfsAuthorizationConstants.TransactionalEditMode.WIRE_ENTRY);
// KFSPTS-2968 allows DM to edit additional charge amount
editModes.add(CUPaymentRequestEditMode.ADDITONAL_CHARGE_AMOUNT_EDITABLE);
}
if (editModes.contains(PaymentRequestEditMode.TAX_INFO_VIEWABLE)) {
editModes.remove(PaymentRequestEditMode.TAX_INFO_VIEWABLE);
}
// KFSPTS-2712 : allow payment method review to view tax info
if ((PaymentRequestStatuses.APPDOC_DEPARTMENT_APPROVED.equals(paymentRequestDocument.getApplicationDocumentStatus()) || PaymentRequestStatuses.APPDOC_PAYMENT_METHOD_REVIEW.equals(paymentRequestDocument.getApplicationDocumentStatus())) && // if and only if the preq has gone through tax review would TaxClassificationCode be non-empty
!StringUtils.isEmpty(paymentRequestDocument.getTaxClassificationCode())) {
editModes.add(PaymentRequestEditMode.TAX_INFO_VIEWABLE);
}
return editModes;
}
Aggregations