Search in sources :

Example 1 with ConcurBatchReportLineValidationErrorItem

use of edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractValidationServiceImpl method validateEmployeeGroupId.

@Override
public boolean validateEmployeeGroupId(ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractBatchReportData reportData) {
    boolean valid = concurEmployeeInfoValidationService.isEmployeeGroupIdValid(line.getEmployeeGroupId());
    if (valid) {
        LOG.debug("Found a valid employee group id.");
    } else {
        String validationError = ("Found an invalid employee group id: " + line.getEmployeeGroupId() + ".  We expected the group ID to be in this list:" + concurBatchUtilityService.getConcurParameterValue(ConcurParameterConstants.CONCUR_CUSTOMER_PROFILE_GROUP_ID));
        reportData.addValidationErrorFileLine(new ConcurBatchReportLineValidationErrorItem(line, validationError));
        LOG.error("validateEmployeeGroupId, " + validationError);
    }
    return valid;
}
Also used : ConcurBatchReportLineValidationErrorItem(edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)

Example 2 with ConcurBatchReportLineValidationErrorItem

use of edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractValidationServiceImpl method validateDebitCreditField.

@Override
public boolean validateDebitCreditField(ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractBatchReportData reportData) {
    boolean valid = StringUtils.equalsIgnoreCase(line.getJounalDebitCredit(), ConcurConstants.CREDIT) || StringUtils.equalsIgnoreCase(line.getJounalDebitCredit(), ConcurConstants.DEBIT);
    if (valid) {
        LOG.debug("validateDebitCreditField, found a valid debit/credit.");
    } else {
        String validationError = "Invalid debit or credit: " + line.getJounalDebitCredit();
        reportData.addValidationErrorFileLine(new ConcurBatchReportLineValidationErrorItem(line, validationError));
        LOG.error("validateDebitCreditField, " + validationError);
    }
    return valid;
}
Also used : ConcurBatchReportLineValidationErrorItem(edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)

Example 3 with ConcurBatchReportLineValidationErrorItem

use of edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractValidationServiceImpl method validateAccountingLineWithObjectCodeOverrides.

private boolean validateAccountingLineWithObjectCodeOverrides(ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractBatchReportData reportData, String overriddenObjectCode, String overriddenSubObjectCode) {
    if (!getConcurStandardAccountingExtractCashAdvanceService().isCashAdvanceLine(line)) {
        logErrorsWithOriginalAccountingDetails(line);
        ValidationResult overriddenValidationResults = buildValidationResult(buildConcurAccountingInformation(line, overriddenObjectCode, overriddenSubObjectCode), true);
        if (overriddenValidationResults.isNotValid()) {
            reportData.addValidationErrorFileLine(new ConcurBatchReportLineValidationErrorItem(line, overriddenValidationResults.getMessages()));
        }
        return overriddenValidationResults.isValid();
    } else {
        LOG.debug("validateAccountingLineWithObjectCodeOverrides, 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)

Example 4 with ConcurBatchReportLineValidationErrorItem

use of edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractValidationServiceImpl method validateAmountsAndDebitCreditCode.

@Override
public boolean validateAmountsAndDebitCreditCode(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile, ConcurStandardAccountingExtractBatchReportData reportData) {
    KualiDecimal journalTotal = concurStandardAccountingExtractFile.getJournalAmountTotal();
    KualiDecimal detailTotal = KualiDecimal.ZERO;
    boolean debitCreditValid = true;
    boolean employeeGroupIdValid = true;
    boolean journalTotalValidation = true;
    for (ConcurStandardAccountingExtractDetailLine line : concurStandardAccountingExtractFile.getConcurStandardAccountingExtractDetailLines()) {
        if (line.getJournalAmount() != null) {
            detailTotal = detailTotal.add(line.getJournalAmount());
        } else {
            String validationError = "Parsed a null KualiDecimal from the original value of " + line.getJournalAmountString();
            reportData.addValidationErrorFileLine(new ConcurBatchReportLineValidationErrorItem(line, validationError));
            LOG.error("validateAmountsAndDebitCreditCode, " + validationError);
            journalTotalValidation = false;
        }
        debitCreditValid &= validateDebitCreditField(line, reportData);
        employeeGroupIdValid &= validateEmployeeGroupId(line, reportData);
    }
    journalTotalValidation = journalTotalValidation && detailTotal.equals(journalTotal);
    if (journalTotalValidation) {
        LOG.debug("validateAmounts, journal total: " + journalTotal.doubleValue() + " and detailTotal: " + detailTotal.doubleValue() + " do match.");
    } else {
        String validationError = "The journal total (" + journalTotal + ") does not equal the detail line total (" + detailTotal + ")";
        reportData.addHeaderValidationError(validationError);
        LOG.error("validateAmounts, " + validationError);
    }
    return journalTotalValidation && debitCreditValid && employeeGroupIdValid;
}
Also used : ConcurBatchReportLineValidationErrorItem(edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) ConcurStandardAccountingExtractDetailLine(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)

Example 5 with ConcurBatchReportLineValidationErrorItem

use of edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractValidationServiceImpl method validateEmployeeId.

@Override
public boolean validateEmployeeId(ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractBatchReportData reportData) {
    boolean valid = getConcurEmployeeInfoValidationService().validPerson(line.getEmployeeId());
    if (!valid) {
        reportData.addValidationErrorFileLine(new ConcurBatchReportLineValidationErrorItem(line, getConfigurationService().getPropertyValueAsString(ConcurKeyConstants.CONCUR_EMPLOYEE_ID_NOT_FOUND_IN_KFS)));
        LOG.error("validateEmployeeId, Found a an invalid employee ID: " + line.getEmployeeId());
    }
    return valid;
}
Also used : ConcurBatchReportLineValidationErrorItem(edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)

Aggregations

ConcurBatchReportLineValidationErrorItem (edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)12 ValidationResult (edu.cornell.kfs.concur.businessobjects.ValidationResult)2 ConcurStandardAccountingExtractDetailLine (edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)1 ConcurAccountInfo (edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)1 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)1