Search in sources :

Example 1 with ConcurStandardAccountingExtractBatchReportData

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

the class ConcurStandardAccountExtractPdpEntryServiceImplTest method setUp.

@Before
public void setUp() throws Exception {
    pdpEntryService = new ConcurStandardAccountExtractPdpEntryServiceImpl();
    pdpEntryService.setPayeeNameFieldSize(new Integer(40));
    pdpEntryService.setDateTimeService(new DateTimeServiceImpl());
    reportData = new ConcurStandardAccountingExtractBatchReportData();
}
Also used : DateTimeServiceImpl(org.kuali.rice.core.impl.datetime.DateTimeServiceImpl) ConcurStandardAccountingExtractBatchReportData(edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData) Before(org.junit.Before)

Example 2 with ConcurStandardAccountingExtractBatchReportData

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

the class ConcurStandardAccountingExtractCollectorBatchBuilderTest method assertCollectorBatchIsBuiltProperly.

protected void assertCollectorBatchIsBuiltProperly(ConcurCollectorBatchFixture expectedFixture, ConcurSAEFileFixture fixtureToBuildFrom) throws Exception {
    CollectorBatch expected = expectedFixture.toCollectorBatch();
    List<ConcurSAEDetailLineFixture> lineFixtures = ConcurFixtureUtils.getFixturesContainingParentFixture(ConcurSAEDetailLineFixture.class, fixtureToBuildFrom, ConcurSAEDetailLineFixture::getExtractFile);
    ConcurStandardAccountingExtractFile saeFileContents = fixtureToBuildFrom.toExtractFile();
    ConcurStandardAccountingExtractBatchReportData reportData = new ConcurStandardAccountingExtractBatchReportData();
    CollectorBatch actual = builder.buildCollectorBatchFromStandardAccountingExtract(1, saeFileContents, reportData);
    assertNotNull("The SAE file contents should have been converted to a CollectorBatch successfully", actual);
    assertCollectorBatchHasCorrectData(expected, actual);
    assertReportHasCorrectErrorLinesAndOrdering(lineFixtures, reportData);
    assertReportHasCorrectPendingClientLinesAndOrdering(lineFixtures, reportData);
    assertReportHasCorrectCashAdvanceStatistics(lineFixtures, reportData);
    assertReportHasCorrectCorporateCardStatistics(lineFixtures, reportData);
    assertReportHasCorrectPseudoPaymentCodeStatistics(lineFixtures, reportData);
}
Also used : CollectorBatch(org.kuali.kfs.gl.batch.CollectorBatch) ConcurSAEDetailLineFixture(edu.cornell.kfs.concur.batch.fixture.ConcurSAEDetailLineFixture) ConcurStandardAccountingExtractFile(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile) ConcurStandardAccountingExtractBatchReportData(edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData)

Example 3 with ConcurStandardAccountingExtractBatchReportData

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

the class ConcurStandardAccountingExtractCreateCollectorFileServiceImplTest method assertCollectorFileIsGeneratedCorrectly.

protected void assertCollectorFileIsGeneratedCorrectly(String expectedResultsFileName, ConcurCollectorBatchFixture fixture) throws Exception {
    ConcurStandardAccountingExtractBatchReportData reportData = new ConcurStandardAccountingExtractBatchReportData();
    ConcurStandardAccountingExtractFile saeFileContents = new ConcurStandardAccountingExtractFile();
    saeFileContents.setOriginalFileName(fixture.name() + GeneralLedgerConstants.BatchFileSystem.TEXT_EXTENSION);
    String collectorFileName = collectorFileService.buildCollectorFile(saeFileContents, reportData);
    assertTrue("Collector file did not get created successfully", StringUtils.isNotBlank(collectorFileName));
    assertGeneratedCollectorFileHasCorrectName(saeFileContents.getOriginalFileName(), collectorFileName);
    String expectedResultsFilePath = EXPECTED_RESULTS_DIRECTORY_PATH + expectedResultsFileName;
    String actualResultsFilePath = COLLECTOR_OUTPUT_DIRECTORY_PATH + collectorFileName;
    assertFileContentsAreCorrect(expectedResultsFilePath, actualResultsFilePath);
}
Also used : ConcurStandardAccountingExtractFile(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile) ConcurStandardAccountingExtractBatchReportData(edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData)

Example 4 with ConcurStandardAccountingExtractBatchReportData

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

the class ConcurStandardAccountingExtractToPdpAndCollectorStep method execute.

@Override
public boolean execute(String jobName, Date jobRunDate) throws InterruptedException {
    List<String> listOfSaeFullyQualifiedFileNames = getConcurStandardAccountingExtractService().buildListOfFullyQualifiedFileNamesToBeProcessed();
    if (CollectionUtils.isNotEmpty(listOfSaeFullyQualifiedFileNames)) {
        for (String saeFullyQualifiedFileName : listOfSaeFullyQualifiedFileNames) {
            LOG.debug("execute, processing: " + saeFullyQualifiedFileName);
            ConcurStandardAccountingExtractBatchReportData reportData = new ConcurStandardAccountingExtractBatchReportData();
            try {
                processCurrentFileAndExtractPdpFeedAndCollectorFromSAEFile(saeFullyQualifiedFileName, reportData);
                File reportFile = getConcurStandardAccountingExtractReportService().generateReport(reportData);
                getConcurStandardAccountingExtractReportService().sendResultsEmail(reportData, reportFile);
            } catch (Exception e) {
                LOG.error("execute, there was an unexpected error processing a file: ", e);
            } finally {
                getFileStorageService().removeDoneFiles(Collections.singletonList(saeFullyQualifiedFileName));
            }
        }
    } else {
        LOG.info("There were no SAE files to process");
        getConcurStandardAccountingExtractReportService().sendEmailThatNoFileWasProcesed();
    }
    return true;
}
Also used : ConcurStandardAccountingExtractBatchReportData(edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData) ConcurStandardAccountingExtractFile(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile) File(java.io.File) IOException(java.io.IOException)

Example 5 with ConcurStandardAccountingExtractBatchReportData

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

the class ConcurStandardAccountingExtractCreateCollectorFileServiceImplTest method assertCollectorFileIsNotGenerated.

protected void assertCollectorFileIsNotGenerated(String fixtureName) throws Exception {
    ConcurStandardAccountingExtractBatchReportData reportData = new ConcurStandardAccountingExtractBatchReportData();
    ConcurStandardAccountingExtractFile saeFileContents = new ConcurStandardAccountingExtractFile();
    saeFileContents.setOriginalFileName(fixtureName + GeneralLedgerConstants.BatchFileSystem.TEXT_EXTENSION);
    String collectorFilePath = collectorFileService.buildCollectorFile(saeFileContents, reportData);
    assertTrue("A Collector file should not have been created", StringUtils.isBlank(collectorFilePath));
}
Also used : ConcurStandardAccountingExtractFile(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile) ConcurStandardAccountingExtractBatchReportData(edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData)

Aggregations

ConcurStandardAccountingExtractBatchReportData (edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData)6 ConcurStandardAccountingExtractFile (edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile)4 Before (org.junit.Before)2 ConcurParameterConstantsFixture (edu.cornell.kfs.concur.batch.fixture.ConcurParameterConstantsFixture)1 ConcurSAEDetailLineFixture (edu.cornell.kfs.concur.batch.fixture.ConcurSAEDetailLineFixture)1 File (java.io.File)1 IOException (java.io.IOException)1 CollectorBatch (org.kuali.kfs.gl.batch.CollectorBatch)1 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)1 DateTimeServiceImpl (org.kuali.rice.core.impl.datetime.DateTimeServiceImpl)1