Search in sources :

Example 1 with PdpFeedDetailEntry

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;
}
Also used : PdpFeedDetailEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry) ArrayList(java.util.ArrayList) PdpFeedAccountingEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)

Example 2 with PdpFeedDetailEntry

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;
}
Also used : PdpFeedFileBaseEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry) ArrayList(java.util.ArrayList) 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) ConcurStandardAccountingExtractDetailLine(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)

Example 3 with PdpFeedDetailEntry

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;
}
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 4 with PdpFeedDetailEntry

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;
}
Also used : PdpFeedDetailEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry)

Example 5 with PdpFeedDetailEntry

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;
}
Also used : PdpFeedDetailEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry)

Aggregations

PdpFeedDetailEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry)12 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)7 PdpFeedAccountingEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)5 PdpFeedGroupEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry)4 ArrayList (java.util.ArrayList)4 DebitCreditTotal (edu.cornell.kfs.concur.batch.service.impl.ConcurStandardAccountExtractPdpEntryServiceImpl.DebitCreditTotal)2 PdpFeedFileBaseEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry)2 Test (org.junit.Test)2 ConcurRequestExtractRequestDetailFileLine (edu.cornell.kfs.concur.batch.businessobject.ConcurRequestExtractRequestDetailFileLine)1 ConcurStandardAccountingExtractDetailLine (edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)1 PdpFeedTrailerEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedTrailerEntry)1