use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountExtractPdpEntryServiceImpl method createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections.
@Override
public PdpFeedFileBaseEntry createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections(PdpFeedFileBaseEntry pdpFeedFileBaseEntry, ConcurStandardAccountingExtractBatchReportData reportData) {
LOG.debug("Entering createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections");
PdpFeedFileBaseEntry newBaseEntry = new PdpFeedFileBaseEntry();
newBaseEntry.setHeader(copyHeaderEntry(pdpFeedFileBaseEntry.getHeader()));
newBaseEntry.setVersion(pdpFeedFileBaseEntry.getVersion());
addGroupEntriesToNewBaseEntry(newBaseEntry, pdpFeedFileBaseEntry);
newBaseEntry.setTrailer(buildPdpFeedTrailerEntry(newBaseEntry, reportData));
return newBaseEntry;
}
use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountingExtractServiceImpl method buildPdpFeedFileBaseEntry.
private PdpFeedFileBaseEntry buildPdpFeedFileBaseEntry(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile, ConcurStandardAccountingExtractBatchReportData reportData) {
PdpFeedFileBaseEntry pdpFeedFileBaseEntry = new PdpFeedFileBaseEntry();
pdpFeedFileBaseEntry.setVersion(ConcurConstants.FEED_FILE_ENTRY_HEADER_VERSION);
pdpFeedFileBaseEntry.setHeader(getConcurStandardAccountExtractPdpEntryService().buildPdpFeedHeaderEntry(concurStandardAccountingExtractFile.getBatchDate()));
int totalReimbursementLineCount = 0;
KualiDecimal totalReimbursementDollarAmount = KualiDecimal.ZERO;
for (ConcurStandardAccountingExtractDetailLine line : concurStandardAccountingExtractFile.getConcurStandardAccountingExtractDetailLines()) {
if (shouldProcessSAELineToPDP(line)) {
if (shouldLineTotalsBeAddedToReimbursementReportTotals(line)) {
totalReimbursementLineCount++;
totalReimbursementDollarAmount = totalReimbursementDollarAmount.add(line.getJournalAmount());
}
logJournalAccountCodeOverridden(line, reportData);
String overriddenObjectCode = getParameterService().getParameterValueAsString(CUKFSConstants.ParameterNamespaces.CONCUR, CUKFSParameterKeyConstants.ALL_COMPONENTS, ConcurParameterConstants.CONCUR_SAE_PDP_DEFAULT_OBJECT_CODE);
String overriddenSubObjectCode = StringUtils.EMPTY;
if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountingExtractDetailLineWithObjectCodeOverrideForPdp(line, reportData, overriddenObjectCode, overriddenSubObjectCode)) {
buildAndUpdateAccountingEntryFromLine(pdpFeedFileBaseEntry, line, concurStandardAccountingExtractFile);
}
}
}
reportData.getReimbursementsInExpenseReport().setRecordCount(totalReimbursementLineCount);
reportData.getReimbursementsInExpenseReport().setDollarAmount(totalReimbursementDollarAmount);
pdpFeedFileBaseEntry.setTrailer(getConcurStandardAccountExtractPdpEntryService().buildPdpFeedTrailerEntry(pdpFeedFileBaseEntry, reportData));
return pdpFeedFileBaseEntry;
}
use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountExtractPdpEntryServiceImplTest method createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections_OneTransaction.
@Test
public void createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections_OneTransaction() {
PdpFeedFileBaseEntry pdpFeedFileBaseEntry = PdpFeedFileBaseEntryFixture.FEED_ONE_TRANS_ZER_ONE_TRANS_POSITIVE.toPdpFeedFileBaseEntry();
assertEquals("Should have 1 group", 1, pdpFeedFileBaseEntry.getGroup().size());
assertEquals("Should have 2 transactions", 2, pdpFeedFileBaseEntry.getGroup().get(0).getDetail().get(0).getAccounting().size());
PdpFeedFileBaseEntry cleaned = pdpEntryService.createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections(pdpFeedFileBaseEntry, reportData);
assertEquals("Should have 1 group", 1, cleaned.getGroup().size());
assertEquals("Should have 1 detail", 1, cleaned.getGroup().get(0).getDetail().size());
assertEquals("Should have 1 transaction", 1, cleaned.getGroup().get(0).getDetail().get(0).getAccounting().size());
}
use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountExtractPdpEntryServiceImplTest method createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections_MultipleGroups.
@Test
public void createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections_MultipleGroups() {
PdpFeedFileBaseEntry pdpFeedFileBaseEntry = PdpFeedFileBaseEntryFixture.FEED_TWO_GROUPS_ONE_ZERO.toPdpFeedFileBaseEntry();
assertEquals("Should have 2 group in original feed file", 2, pdpFeedFileBaseEntry.getGroup().size());
PdpFeedFileBaseEntry cleaned = pdpEntryService.createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections(pdpFeedFileBaseEntry, reportData);
assertEquals("Should have 1 group in cleaned feed file", 1, cleaned.getGroup().size());
}
use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountExtractPdpEntryServiceImplTest method createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections_TransSumToNegative.
@Test
public void createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections_TransSumToNegative() {
PdpFeedFileBaseEntry pdpFeedFileBaseEntry = PdpFeedFileBaseEntryFixture.FEED_TWO_TRANS_SUM_TO_NEGATIVE.toPdpFeedFileBaseEntry();
assertEquals("Should have 1 group", 1, pdpFeedFileBaseEntry.getGroup().size());
PdpFeedFileBaseEntry cleaned = pdpEntryService.createPdpFileBaseEntryThatDoesNotContainNonReimbursableSections(pdpFeedFileBaseEntry, reportData);
assertEquals("Should have no groups", 0, cleaned.getGroup().size());
}
Aggregations