use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class AccountingLineRuleHelperServiceImpl method getAccountingLineValidationErrors.
@Override
public List<AccountingLineValidationError> getAccountingLineValidationErrors(AccountingLine accountingLine, boolean useShortMessages) {
List<AccountingLineValidationError> validationErrors = new ArrayList<>();
// CORNELL FIX:
if (ObjectUtils.isNull(accountingLine)) {
return validationErrors;
}
// get the accounting line sequence string to identify which line has error.
String accountIdentifyingPropertyName = getAccountIdentifyingPropertyName(accountingLine);
// retrieve accounting line objects to validate
Chart chart = accountingLine.getChart();
Account account = accountingLine.getAccount();
ObjectCode objectCode = accountingLine.getObjectCode();
validationErrors.addAll(getChartValidationErrors(chart, KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, accountIdentifyingPropertyName, useShortMessages));
validationErrors.addAll(getAccountValidationErrors(account, KFSPropertyConstants.ACCOUNT_NUMBER, accountIdentifyingPropertyName, useShortMessages));
// sub account is not required
if (StringUtils.isNotBlank(accountingLine.getSubAccountNumber()) && !accountingLine.getSubAccountNumber().equals(KFSConstants.getDashSubAccountNumber())) {
SubAccount subAccount = accountingLine.getSubAccount();
validationErrors.addAll(getSubAccountValidationErrors(subAccount, KFSPropertyConstants.SUB_ACCOUNT_NUMBER, accountIdentifyingPropertyName, useShortMessages));
}
validationErrors.addAll(getObjectCodeValidationErrors(objectCode, KFSPropertyConstants.FINANCIAL_OBJECT_CODE, accountIdentifyingPropertyName, useShortMessages));
// sub object is not required
if (StringUtils.isNotBlank(accountingLine.getFinancialSubObjectCode())) {
SubObjectCode subObjectCode = accountingLine.getSubObjectCode();
validationErrors.addAll(getSubObjectCodeValidationErrors(subObjectCode, KFSPropertyConstants.FINANCIAL_SUB_OBJECT_CODE, accountIdentifyingPropertyName, useShortMessages));
}
// project code is not required
if (StringUtils.isNotBlank(accountingLine.getProjectCode())) {
ProjectCode projectCode = accountingLine.getProject();
validationErrors.addAll(getProjectCodeValidationErrors(projectCode, KFSConstants.PROJECT_CODE_PROPERTY_NAME, accountIdentifyingPropertyName, useShortMessages));
}
if (StringUtils.isNotBlank(accountingLine.getReferenceOriginCode())) {
OriginationCode referenceOrigin = accountingLine.getReferenceOrigin();
validationErrors.addAll(getReferenceOriginCodeValidationErrors(accountIdentifyingPropertyName, referenceOrigin, useShortMessages));
}
if (StringUtils.isNotBlank(accountingLine.getReferenceTypeCode())) {
DocumentType referenceType = accountingLine.getReferenceFinancialSystemDocumentType();
validationErrors.addAll(getReferenceTypeCodeValidationErrors(accountingLine.getReferenceTypeCode(), referenceType, accountIdentifyingPropertyName, useShortMessages));
}
return validationErrors;
}
use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class AutoCancelBatchDaoJdbc method canAutoCancelDocType.
private boolean canAutoCancelDocType(String docTypeId) {
DocumentType docType = docTypes.get(docTypeId);
if (ObjectUtils.isNull(docType)) {
docType = KEWServiceLocator.getDocumentTypeService().getDocumentTypeById(docTypeId);
docTypes.put(docTypeId, docType);
}
if (cancelDocumentTypes.isEmpty()) {
cancelDocumentTypes = parameterService.getParameterValuesAsString(AutoCancelBatchStep.class, CUKFSParameterKeyConstants.AUTO_CANCEL_DOC_TYPES_PARAMETER);
}
return cancelDocumentTypes.contains(docType.getName());
}
use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class CuAutoDisapproveDocumentsServiceImpl method checkIfParentDocumentTypeParameterExists.
protected boolean checkIfParentDocumentTypeParameterExists() {
// check to make sure the system parameter for Parent Document Type = FP has been setup...
if (!getParameterService().parameterExists(AutoDisapproveDocumentsStep.class, KFSParameterKeyConstants.YearEndAutoDisapprovalConstants.YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE)) {
LOG.warn("YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE System parameter does not exist in the " + "parameters list. The job can not continue without this parameter");
getAutoDisapproveErrorReportWriterService().writeFormattedMessageLine("YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE System parameter does not exist in the " + "parameters list. The job can not continue without this parameter");
return false;
}
List<DocumentType> parentDocumentTypes = this.getYearEndAutoDisapproveParentDocumentTypes();
for (DocumentType parentDocumentType : parentDocumentTypes) {
if (ObjectUtils.isNull(documentTypeService.getDocumentTypeByName(parentDocumentType.getName()))) {
LOG.warn("Invalid Document Type: The value for System Parameter YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE " + "is invalid. The auto disapproval job cannot use this value.");
getAutoDisapproveErrorReportWriterService().writeFormattedMessageLine("Invalid Document Type: The value for System Parameter YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE " + "is invalid. The auto disapproval job cannot use this value.");
}
}
return true;
}
use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class CuAutoDisapproveDocumentsServiceImpl method checkIfDocumentEligibleForAutoDispproval.
/**
* @see org.kuali.kfs.sys.batch.service.impl.AutoDisapproveDocumentsServiceImpl#checkIfDocumentEligibleForAutoDispproval(org.kuali.kfs.krad.bo.DocumentHeader)
*/
@Override
protected boolean checkIfDocumentEligibleForAutoDispproval(DocumentHeader documentHeader) {
boolean documentEligible = false;
List<DocumentType> parentDocumentTypes = this.getYearEndAutoDisapproveParentDocumentTypes();
String documentTypeName = documentHeader.getWorkflowDocument().getDocumentTypeName();
DocumentType childDocumentType = documentTypeService.getDocumentTypeByName(documentTypeName);
for (DocumentType parentDocumentType : parentDocumentTypes) {
documentEligible = childDocumentType.getParentId().equals(parentDocumentType.getId());
if (documentEligible) {
break;
}
}
return documentEligible;
}
use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class AbstractRelatedView method getUrl.
public String getUrl() {
String documentTypeName = this.getDocumentTypeName();
DocumentType docType = KEWServiceLocator.getDocumentTypeService().getDocumentTypeByName(documentTypeName);
String docHandlerUrl = docType.getResolvedDocumentHandlerUrl();
int endSubString = docHandlerUrl.lastIndexOf("/");
String serverName = docHandlerUrl.substring(0, endSubString);
String handler = docHandlerUrl.substring(endSubString + 1, docHandlerUrl.lastIndexOf("?"));
return serverName + "/" + handler + "?channelTitle=" + docType.getName() + "&" + KRADConstants.DISPATCH_REQUEST_PARAMETER + "=" + KRADConstants.DOC_HANDLER_METHOD + "&" + KRADConstants.PARAMETER_DOC_ID + "=" + this.getDocumentNumber() + "&" + KRADConstants.PARAMETER_COMMAND + "=" + KewApiConstants.DOCSEARCH_COMMAND;
}
Aggregations