Search in sources :

Example 6 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractValidationServiceImpl method validateAccountingLine.

private boolean validateAccountingLine(ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractBatchReportData reportData) {
    if (!getConcurStandardAccountingExtractCashAdvanceService().isCashAdvanceLine(line)) {
        ConcurAccountInfo accountingInformation = buildConcurAccountingInformation(line);
        ValidationResult validationResults = buildValidationResult(accountingInformation, false);
        if (validationResults.isNotValid()) {
            reportData.addValidationErrorFileLine(new ConcurBatchReportLineValidationErrorItem(line, validationResults.getMessages()));
        }
        return validationResults.isValid();
    } else {
        LOG.debug("validateAccountingLine, found a cash advance line, no need to validate");
        return true;
    }
}
Also used : ConcurBatchReportLineValidationErrorItem(edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem) ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)

Example 7 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractValidationServiceImpl method logErrorsWithOriginalAccountingDetails.

private void logErrorsWithOriginalAccountingDetails(ConcurStandardAccountingExtractDetailLine line) {
    ConcurAccountInfo accountingInformation = buildConcurAccountingInformation(line);
    buildValidationResult(accountingInformation, false);
}
Also used : ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)

Example 8 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractValidationServiceImpl method buildConcurAccountingInformation.

private ConcurAccountInfo buildConcurAccountingInformation(ConcurStandardAccountingExtractDetailLine line) {
    String objectCode = line.getJournalAccountCode();
    String subObjectCode;
    if (getConcurBatchUtilityService().lineRepresentsPersonalExpenseChargedToCorporateCard(line)) {
        subObjectCode = StringUtils.EMPTY;
    } else {
        subObjectCode = line.getSubObjectCode();
    }
    ConcurAccountInfo accountingInformation = buildConcurAccountingInformation(line, objectCode, subObjectCode);
    return accountingInformation;
}
Also used : ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)

Example 9 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo 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;
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)

Example 10 with ConcurAccountInfo

use of edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo 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();
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)

Aggregations

ConcurAccountInfo (edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)13 ValidationResult (edu.cornell.kfs.concur.businessobjects.ValidationResult)3 ConcurStandardAccountingExtractDetailLine (edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)2 ConcurReport (edu.cornell.kfs.concur.businessobjects.ConcurReport)2 ConcurBatchReportLineValidationErrorItem (edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)1 PdpFeedAccountingEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)1 ExpenseReportDetailsDTO (edu.cornell.kfs.concur.rest.xmlObjects.ExpenseReportDetailsDTO)1 TravelRequestDetailsDTO (edu.cornell.kfs.concur.rest.xmlObjects.TravelRequestDetailsDTO)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1