Search in sources :

Example 1 with PdpFeedGroupEntry

use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry in project cu-kfs by CU-CommunityApps.

the class ConcurCashAdvancePdpFeedFileServiceImpl method buildPdpFeedGroupEntry.

private PdpFeedGroupEntry buildPdpFeedGroupEntry(ConcurRequestExtractRequestDetailFileLine detailFileLine, PdpFeedPayeeIdEntry pdpPayeeIdEntry, List<PdpFeedDetailEntry> pdpDetailEntries) {
    PdpFeedGroupEntry pdpGroupEntry = new PdpFeedGroupEntry();
    pdpGroupEntry.setPayeeName(getConcurBatchUtilityService().formatPdpPayeeName(detailFileLine.getLastName(), detailFileLine.getFirstName(), detailFileLine.getMiddleInitial()));
    pdpGroupEntry.setPayeeId(pdpPayeeIdEntry);
    pdpGroupEntry.setCustomerInstitutionIdentifier(StringUtils.EMPTY);
    pdpGroupEntry.setPaymentDate(getConcurBatchUtilityService().formatDate_MMddyyyy(detailFileLine.getBatchDate()));
    pdpGroupEntry.setCombineGroupInd(ConcurConstants.COMBINED_GROUP_INDICATOR);
    pdpGroupEntry.setBankCode(ConcurConstants.BANK_CODE);
    pdpGroupEntry.setDetail(pdpDetailEntries);
    return pdpGroupEntry;
}
Also used : PdpFeedGroupEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry)

Example 2 with PdpFeedGroupEntry

use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry in project cu-kfs by CU-CommunityApps.

the class ConcurCashAdvancePdpFeedFileServiceImpl method buildPdpFeedBaseEntry.

private PdpFeedFileBaseEntry buildPdpFeedBaseEntry(ConcurRequestExtractFile requestExtractFile, ConcurRequestExtractBatchReportData reportData) {
    int totalPdpDetailRecordsCount = 0;
    KualiDecimal totalPdpDetailRecordsAmount = KualiDecimal.ZERO;
    PdpFeedFileBaseEntry pdpBaseEntry = new PdpFeedFileBaseEntry();
    pdpBaseEntry.setHeader(buildPdpFeedHeaderEntry(requestExtractFile.getBatchDate()));
    List<PdpFeedGroupEntry> groupEntries = new ArrayList<PdpFeedGroupEntry>();
    for (ConcurRequestExtractRequestDetailFileLine detailFileLine : requestExtractFile.getRequestDetails()) {
        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(), requestExtractFile.getFileName());
            totalPdpDetailRecordsCount++;
            totalPdpDetailRecordsAmount = totalPdpDetailRecordsAmount.add(detailFileLine.getRequestAmount());
        }
        updateReportDataForDetailFileLineBeingProcessed(reportData, detailFileLine, totalPdpDetailRecordsCount, totalPdpDetailRecordsAmount);
    }
    pdpBaseEntry.setGroup(groupEntries);
    pdpBaseEntry.setTrailer(buildPdpFeedTrailerEntry(totalPdpDetailRecordsCount, totalPdpDetailRecordsAmount));
    pdpBaseEntry.setVersion(ConcurConstants.FEED_FILE_ENTRY_HEADER_VERSION);
    return pdpBaseEntry;
}
Also used : PdpFeedFileBaseEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry) ArrayList(java.util.ArrayList) ConcurRequestExtractRequestDetailFileLine(edu.cornell.kfs.concur.batch.businessobject.ConcurRequestExtractRequestDetailFileLine) PdpFeedDetailEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal) PdpFeedGroupEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry)

Example 3 with PdpFeedGroupEntry

use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractServiceImpl method buildAndUpdateAccountingEntryFromLine.

private void buildAndUpdateAccountingEntryFromLine(PdpFeedFileBaseEntry pdpFeedFileBaseEntry, ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) {
    PdpFeedGroupEntry currentGroup = getGroupEntryForLine(pdpFeedFileBaseEntry, line);
    PdpFeedDetailEntry currentDetail = getDetailEntryForLine(currentGroup, line);
    PdpFeedAccountingEntry currentAccounting = getAccountingEntryForLine(currentDetail, line, concurStandardAccountingExtractFile);
    KualiDecimal newAmount = line.getJournalAmount().add(currentAccounting.getAmount());
    currentAccounting.setAmount(newAmount);
}
Also used : PdpFeedDetailEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal) PdpFeedGroupEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry) PdpFeedAccountingEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)

Example 4 with PdpFeedGroupEntry

use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry 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;
}
Also used : PdpFeedDetailEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal) PdpFeedTrailerEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedTrailerEntry) PdpFeedGroupEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry) PdpFeedAccountingEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)

Example 5 with PdpFeedGroupEntry

use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry in project cu-kfs by CU-CommunityApps.

the class ConcurCreateCashAdvancePdpFeedFileServiceImpl method buildPdpFeedGroupEntry.

private PdpFeedGroupEntry buildPdpFeedGroupEntry(ConcurStandardAccountingExtractDetailLine detailFileLine, PdpFeedPayeeIdEntry pdpPayeeIdEntry, List<PdpFeedDetailEntry> pdpDetailEntries) {
    PdpFeedGroupEntry pdpGroupEntry = new PdpFeedGroupEntry();
    pdpGroupEntry.setPayeeName(getConcurBatchUtilityService().formatPdpPayeeName(detailFileLine.getEmployeeLastName(), detailFileLine.getEmployeeFirstName(), detailFileLine.getEmployeeMiddleInitial()));
    pdpGroupEntry.setPayeeId(pdpPayeeIdEntry);
    pdpGroupEntry.setCustomerInstitutionIdentifier(StringUtils.EMPTY);
    pdpGroupEntry.setPaymentDate(getConcurBatchUtilityService().formatDate_MMddyyyy(detailFileLine.getBatchDate()));
    pdpGroupEntry.setCombineGroupInd(ConcurConstants.COMBINED_GROUP_INDICATOR);
    pdpGroupEntry.setBankCode(ConcurConstants.BANK_CODE);
    pdpGroupEntry.setDetail(pdpDetailEntries);
    return pdpGroupEntry;
}
Also used : PdpFeedGroupEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry)

Aggregations

PdpFeedGroupEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry)10 PdpFeedDetailEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry)4 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)4 PdpFeedAccountingEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)2 PdpFeedFileBaseEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry)2 ArrayList (java.util.ArrayList)2 ConcurRequestExtractRequestDetailFileLine (edu.cornell.kfs.concur.batch.businessobject.ConcurRequestExtractRequestDetailFileLine)1 ConcurStandardAccountingExtractDetailLine (edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)1 PdpFeedPayeeIdEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedPayeeIdEntry)1 PdpFeedTrailerEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedTrailerEntry)1