use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurEventNotificationProcessingServiceImpl method validateReportAccountInfo.
private ValidationResult validateReportAccountInfo(ConcurReport concurReport) {
ValidationResult reportValidationResult = new ValidationResult();
LOG.info("validateReportAccountInfo()");
if (concurReport.getAccountInfos() != null && concurReport.getAccountInfos().size() > 0) {
for (ConcurAccountInfo concurAccountInfo : concurReport.getAccountInfos()) {
LOG.info(concurAccountInfo.toString());
if (concurAccountInfo.isForPersonalCorporateCardExpense()) {
reportValidationResult.add(concurAccountValidationService.validateConcurAccountInfoObjectCodeNotRequired(concurAccountInfo));
} else {
reportValidationResult.add(concurAccountValidationService.validateConcurAccountInfo(concurAccountInfo));
}
}
}
LOG.info("Validation Result: " + reportValidationResult.isValid() + ", validation messages: " + reportValidationResult.getErrorMessagesAsOneFormattedString());
return reportValidationResult;
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurRequestExtractFileValidationServiceImpl method requestedCashAdvanceAccountingInformationIsValid.
private boolean requestedCashAdvanceAccountingInformationIsValid(ConcurRequestExtractRequestDetailFileLine detailFileLine) {
ConcurAccountInfo concurAccountInfo = new ConcurAccountInfo(detailFileLine.getChart(), detailFileLine.getAccountNumber(), detailFileLine.getSubAccountNumber(), getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.DEFAULT_TRAVEL_REQUEST_OBJECT_CODE), detailFileLine.getSubObjectCode(), detailFileLine.getProjectCode());
ValidationResult validationResults = getConcurAccountValidationService().validateConcurAccountInfo(concurAccountInfo);
if (validationResults.isNotValid()) {
detailFileLine.getValidationResult().addMessages(validationResults.getMessages());
}
return validationResults.isValid();
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceImpl method checkProjectCode.
public ValidationResult checkProjectCode(String projectCodeParm) {
ValidationResult validationResult = new ValidationResult();
if (StringUtils.isNotBlank(projectCodeParm)) {
ProjectCode projectCode = projectCodeService.getByPrimaryId(projectCodeParm);
String projectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.PROJECT_CODE, projectCodeParm);
validationResult = checkMissingOrInactive(projectCode, MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), projectCodeErrorMessageString), MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), projectCodeErrorMessageString));
}
return validationResult;
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceImpl method checkSubObjectCode.
public ValidationResult checkSubObjectCode(String chartOfAccountsCode, String accountNumber, String objectCode, String subObjectCodeParm) {
ValidationResult validationResult = new ValidationResult();
if (StringUtils.isNotBlank(subObjectCodeParm)) {
SubObjectCode subObjectCode = subObjectCodeService.getByPrimaryIdForCurrentYear(chartOfAccountsCode, accountNumber, objectCode, subObjectCodeParm);
String subObjectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.SUB_OBJECT_CODE, chartOfAccountsCode, accountNumber, objectCode, subObjectCodeParm);
validationResult = checkMissingOrInactive(subObjectCode, MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), subObjectCodeErrorMessageString), MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), subObjectCodeErrorMessageString));
}
return validationResult;
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceImpl method checkValuesAreValid.
private ValidationResult checkValuesAreValid(String chartOfAccountsCode, String accountNumber, String subAccountNumber, String objectCode, String subObjectCode, String projectCode, boolean objectCodeRequired) {
ValidationResult accountValidationResult = checkAccount(chartOfAccountsCode, accountNumber);
if (accountValidationResult.isNotValid()) {
return accountValidationResult;
} else {
ValidationResult validationResult = new ValidationResult();
if (objectCodeRequired) {
updateValidationResultAndAddErrorMessages(validationResult, checkObjectCode(chartOfAccountsCode, objectCode));
}
updateValidationResultAndAddErrorMessages(validationResult, checkSubAccount(chartOfAccountsCode, accountNumber, subAccountNumber));
if (objectCodeRequired) {
updateValidationResultAndAddErrorMessages(validationResult, checkSubObjectCode(chartOfAccountsCode, accountNumber, objectCode, subObjectCode));
}
updateValidationResultAndAddErrorMessages(validationResult, checkProjectCode(projectCode));
return validationResult;
}
}
Aggregations