use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry in project cu-kfs by CU-CommunityApps.
the class ConcurCreateCashAdvancePdpFeedFileServiceImpl method buildPdpFeedDetailEntry.
private PdpFeedDetailEntry buildPdpFeedDetailEntry(ConcurStandardAccountingExtractDetailLine detailFileLine, PdpFeedAccountingEntry pdpAccountingEntry) {
PdpFeedDetailEntry pdpDetailEntry = new PdpFeedDetailEntry();
pdpDetailEntry.setSourceDocNbr(getConcurBatchUtilityService().formatSourceDocumentNumber(getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_CASH_ADVANCE_PDP_DOCUMENT_TYPE), detailFileLine.getCashAdvanceKey()));
pdpDetailEntry.setInvoiceNbr(getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_PDP_DEFAULT_INVOICE_NUMBER));
pdpDetailEntry.setPoNbr(StringUtils.EMPTY);
pdpDetailEntry.setInvoiceDate(getConcurBatchUtilityService().formatDate_MMddyyyy(detailFileLine.getBatchDate()));
pdpDetailEntry.setNetPaymentAmt(detailFileLine.getCashAdvanceAmount());
pdpDetailEntry.setFsOriginCd(getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_AP_PDP_ORIGINATION_CODE));
pdpDetailEntry.setFdocTypCd(getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_CASH_ADVANCE_PDP_DOCUMENT_TYPE));
List<String> paymentTexts = new ArrayList<String>();
paymentTexts.add(detailFileLine.getCashAdvanceName());
pdpDetailEntry.setPaymentText(paymentTexts);
List<PdpFeedAccountingEntry> accountingLines = new ArrayList<PdpFeedAccountingEntry>();
accountingLines.add(pdpAccountingEntry);
pdpDetailEntry.setAccounting(accountingLines);
return pdpDetailEntry;
}
use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry in project cu-kfs by CU-CommunityApps.
the class ConcurCreateCashAdvancePdpFeedFileServiceImpl method buildPdpFeedBaseEntry.
private PdpFeedFileBaseEntry buildPdpFeedBaseEntry(ConcurStandardAccountingExtractFile standardAccountingExtractFile, ConcurSaeRequestedCashAdvanceBatchReportData reportData) {
int totalPdpDetailRecordsCount = 0;
KualiDecimal totalPdpDetailRecordsAmount = KualiDecimal.ZERO;
PdpFeedFileBaseEntry pdpBaseEntry = new PdpFeedFileBaseEntry();
pdpBaseEntry.setHeader(buildPdpFeedHeaderEntry(standardAccountingExtractFile.getBatchDate()));
List<PdpFeedGroupEntry> groupEntries = new ArrayList<PdpFeedGroupEntry>();
for (ConcurStandardAccountingExtractDetailLine detailFileLine : standardAccountingExtractFile.getConcurStandardAccountingExtractDetailLines()) {
if (isDetailFileLineValidCashAdvanceRequest(detailFileLine)) {
PdpFeedDetailEntry pdpDetailEntry = buildPdpFeedDetailEntry(detailFileLine, buildPdpFeedAccountingEntry(detailFileLine));
List<PdpFeedDetailEntry> pdpDetailEntries = new ArrayList<PdpFeedDetailEntry>();
pdpDetailEntries.add(pdpDetailEntry);
groupEntries.add(buildPdpFeedGroupEntry(detailFileLine, buildPdpFeedPayeeIdEntry(detailFileLine), pdpDetailEntries));
recordCashAdvanceGenerationInDuplicateTrackingTable(detailFileLine, pdpDetailEntry.getSourceDocNbr(), standardAccountingExtractFile.getOriginalFileName());
totalPdpDetailRecordsCount++;
totalPdpDetailRecordsAmount = totalPdpDetailRecordsAmount.add(detailFileLine.getCashAdvanceAmount());
}
updateReportDataForDetailFileLineBeingProcessed(reportData, detailFileLine, totalPdpDetailRecordsCount, totalPdpDetailRecordsAmount);
}
pdpBaseEntry.setGroup(groupEntries);
pdpBaseEntry.setTrailer(buildPdpFeedTrailerEntry(totalPdpDetailRecordsCount, totalPdpDetailRecordsAmount));
pdpBaseEntry.setVersion(ConcurConstants.FEED_FILE_ENTRY_HEADER_VERSION);
return pdpBaseEntry;
}
use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountExtractPdpEntryServiceImpl method buildPdpFeedTrailerEntry.
@Override
public PdpFeedTrailerEntry buildPdpFeedTrailerEntry(PdpFeedFileBaseEntry pdpFeedFileBaseEntry, ConcurStandardAccountingExtractBatchReportData reportData) {
PdpFeedTrailerEntry trailerEntry = new PdpFeedTrailerEntry();
KualiDecimal pdpTotal = KualiDecimal.ZERO;
int numberOfDetails = 0;
for (PdpFeedGroupEntry group : pdpFeedFileBaseEntry.getGroup()) {
numberOfDetails += group.getDetail().size();
for (PdpFeedDetailEntry detailEntry : group.getDetail()) {
for (PdpFeedAccountingEntry accountingEntry : detailEntry.getAccounting()) {
pdpTotal = pdpTotal.add(accountingEntry.getAmount());
}
}
}
trailerEntry.setDetailCount(numberOfDetails);
trailerEntry.setDetailTotAmt(pdpTotal);
reportData.getPdpRecordsProcessed().setRecordCount(numberOfDetails);
reportData.getPdpRecordsProcessed().setDollarAmount(pdpTotal);
return trailerEntry;
}
use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountExtractPdpEntryServiceImpl method buildPdpFeedDetailEntry.
@Override
public PdpFeedDetailEntry buildPdpFeedDetailEntry(ConcurStandardAccountingExtractDetailLine line) {
PdpFeedDetailEntry currentDetailEntry = new PdpFeedDetailEntry();
currentDetailEntry.setSourceDocNbr(buildSourceDocumentNumber(line.getReportId()));
currentDetailEntry.setFsOriginCd(getConcurParameterValue(ConcurParameterConstants.CONCUR_AP_PDP_ORIGINATION_CODE));
currentDetailEntry.setFdocTypCd(getConcurParameterValue(ConcurParameterConstants.CONCUR_SAE_PDP_DOCUMENT_TYPE));
currentDetailEntry.setInvoiceNbr(getConcurParameterValue(ConcurParameterConstants.CONCUR_PDP_DEFAULT_INVOICE_NUMBER));
currentDetailEntry.setPoNbr(StringUtils.EMPTY);
currentDetailEntry.setInvoiceDate(formatDate(line.getBatchDate()));
return currentDetailEntry;
}
use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountExtractPdpEntryServiceImpl method copyDetailEntry.
private PdpFeedDetailEntry copyDetailEntry(PdpFeedDetailEntry detailEntry) {
PdpFeedDetailEntry newDetailEntry = new PdpFeedDetailEntry();
newDetailEntry.setSourceDocNbr(detailEntry.getSourceDocNbr());
newDetailEntry.setInvoiceNbr(detailEntry.getInvoiceNbr());
newDetailEntry.setPoNbr(detailEntry.getPoNbr());
newDetailEntry.setInvoiceDate(detailEntry.getInvoiceDate());
newDetailEntry.setFsOriginCd(detailEntry.getFsOriginCd());
newDetailEntry.setFdocTypCd(detailEntry.getFdocTypCd());
return newDetailEntry;
}
Aggregations