Search in sources :

Example 6 with ConcurBatchReportLineValidationErrorItem

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

the class ConcurRequestExtractReportServiceImpl method writeValidationErrorSubReport.

protected void writeValidationErrorSubReport(ConcurRequestExtractBatchReportData reportData) {
    LOG.debug("writeValidationErrorSubReport, entered");
    String rowFormat = "%-24s %-24s %-36s %-36s %-14s";
    String hdrRowFormat = "%-24s %-24s %-36s %-36s %-14s";
    Object[] headerArgs = { "Report ID", "Employee ID", "Last Name", "First Name", "Middle Initial" };
    Object[] headerBreak = { "---------", "-----------", "---------", "----------", "--------------" };
    if (CollectionUtils.isEmpty(reportData.getValidationErrorFileLines())) {
        getReportWriterService().setNewPage(false);
        getReportWriterService().writeSubTitle(getReportValidationErrorsSubTitle());
        getReportWriterService().writeNewLines(1);
        getReportWriterService().writeFormattedMessageLine(ConcurConstants.RequestExtractReport.NO_RECORDS_WITH_VALIDATION_ERRORS_MESSAGE);
    } else {
        getReportWriterService().writeSubTitle(getReportValidationErrorsSubTitle());
        getReportWriterService().writeNewLines(1);
        getReportWriterService().writeFormattedMessageLine(hdrRowFormat, headerBreak);
        getReportWriterService().writeFormattedMessageLine(hdrRowFormat, headerArgs);
        getReportWriterService().writeFormattedMessageLine(hdrRowFormat, headerBreak);
        for (ConcurBatchReportLineValidationErrorItem errorItem : reportData.getValidationErrorFileLines()) {
            getReportWriterService().writeFormattedMessageLine(rowFormat, errorItem.getReportId(), errorItem.getEmployeeId(), errorItem.getLastName(), errorItem.getFirstName(), errorItem.getMiddleInitial());
            getReportWriterService().writeNewLines(1);
            writeErrorItemMessages(errorItem.getItemErrorResults());
            getReportWriterService().writeNewLines(2);
        }
    }
}
Also used : ConcurBatchReportLineValidationErrorItem(edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)

Example 7 with ConcurBatchReportLineValidationErrorItem

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

the class ConcurCashAdvancePdpFeedFileServiceImpl method updateReportDataWithFileLineValidationError.

private void updateReportDataWithFileLineValidationError(ConcurRequestExtractBatchReportData reportData, ConcurRequestExtractRequestDetailFileLine detailFileLine) {
    ConcurBatchReportLineValidationErrorItem errorDetails = new ConcurBatchReportLineValidationErrorItem(detailFileLine.getRequestId(), detailFileLine.getEmployeeId(), detailFileLine.getLastName(), detailFileLine.getFirstName(), detailFileLine.getMiddleInitial(), detailFileLine.getValidationResult().getMessages());
    reportData.getValidationErrorFileLines().add(errorDetails);
}
Also used : ConcurBatchReportLineValidationErrorItem(edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)

Example 8 with ConcurBatchReportLineValidationErrorItem

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

the class ConcurStandardAccountingExtractCollectorBatchBuilder method reportUnprocessedLine.

protected void reportUnprocessedLine(ConcurStandardAccountingExtractDetailLine saeLine, String errorMessage) {
    ConcurBatchReportLineValidationErrorItem errorItem = new ConcurBatchReportLineValidationErrorItem(saeLine, errorMessage);
    reportData.addValidationErrorFileLine(errorItem);
}
Also used : ConcurBatchReportLineValidationErrorItem(edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)

Example 9 with ConcurBatchReportLineValidationErrorItem

use of edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem 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 10 with ConcurBatchReportLineValidationErrorItem

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

the class ConcurStandardAccountingExtractValidationServiceImpl method validateAddressIfCheckPayment.

private boolean validateAddressIfCheckPayment(ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractBatchReportData reportData) {
    boolean valid = true;
    String validationMessage = getConcurEmployeeInfoValidationService().getAddressValidationMessageIfCheckPayment(line.getEmployeeId());
    if (StringUtils.isNotBlank(validationMessage)) {
        valid = false;
        reportData.addValidationErrorFileLine(new ConcurBatchReportLineValidationErrorItem(line, validationMessage));
    }
    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