Search in sources :

Example 11 with PdpFeedDetailEntry

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

the class ConcurCashAdvancePdpFeedFileServiceImpl method buildPdpFeedDetailEntry.

private PdpFeedDetailEntry buildPdpFeedDetailEntry(ConcurRequestExtractRequestDetailFileLine detailFileLine, PdpFeedAccountingEntry pdpAccountingEntry) {
    PdpFeedDetailEntry pdpDetailEntry = new PdpFeedDetailEntry();
    pdpDetailEntry.setSourceDocNbr(getConcurBatchUtilityService().formatSourceDocumentNumber(getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_REQUEST_EXTRACT_PDP_DOCUMENT_TYPE), detailFileLine.getRequestId()));
    pdpDetailEntry.setInvoiceNbr(getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_PDP_DEFAULT_INVOICE_NUMBER));
    pdpDetailEntry.setPoNbr(StringUtils.EMPTY);
    pdpDetailEntry.setInvoiceDate(getConcurBatchUtilityService().formatDate_MMddyyyy(detailFileLine.getBatchDate()));
    pdpDetailEntry.setNetPaymentAmt(detailFileLine.getRequestAmount());
    pdpDetailEntry.setFsOriginCd(getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_AP_PDP_ORIGINATION_CODE));
    pdpDetailEntry.setFdocTypCd(getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_REQUEST_EXTRACT_PDP_DOCUMENT_TYPE));
    List<String> paymentTexts = new ArrayList<String>();
    paymentTexts.add(detailFileLine.getRequestEntryDescription());
    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 12 with PdpFeedDetailEntry

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

the class ConcurStandardAccountExtractPdpEntryServiceImpl method addDetailEntriesToNewGroupEntry.

private void addDetailEntriesToNewGroupEntry(PdpFeedGroupEntry newGroupEntry, PdpFeedGroupEntry originalGroupEntry) {
    for (PdpFeedDetailEntry originalDetailEntry : originalGroupEntry.getDetail()) {
        PdpFeedDetailEntry newDetailEntry = copyDetailEntry(originalDetailEntry);
        KualiDecimal originalDetailTransactionTotal = KualiDecimal.ZERO;
        for (PdpFeedAccountingEntry originalAccountingEntry : originalDetailEntry.getAccounting()) {
            originalDetailTransactionTotal = originalDetailTransactionTotal.add(originalAccountingEntry.getAmount());
            newDetailEntry.getAccounting().add(copyAccountingEntry(originalAccountingEntry));
        }
        cleanAccountingEntriesInDetailEntry(newDetailEntry);
        addNewPaymentDetailToGroupIfTotalIsPositive(newGroupEntry, newDetailEntry, originalDetailTransactionTotal);
    }
}
Also used : PdpFeedDetailEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal) PdpFeedAccountingEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)

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