Search in sources :

Example 1 with PdpFeedAccountingEntry

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

the class ConcurStandardAccountExtractPdpEntryServiceImpl method copyAccountingEntry.

private PdpFeedAccountingEntry copyAccountingEntry(PdpFeedAccountingEntry accountingEntry) {
    PdpFeedAccountingEntry newAccountingEntry = new PdpFeedAccountingEntry();
    newAccountingEntry.setCoaCd(accountingEntry.getCoaCd());
    newAccountingEntry.setAccountNbr(accountingEntry.getAccountNbr());
    newAccountingEntry.setSubAccountNbr(accountingEntry.getSubAccountNbr());
    newAccountingEntry.setObjectCd(accountingEntry.getObjectCd());
    newAccountingEntry.setSubObjectCd(accountingEntry.getSubObjectCd());
    newAccountingEntry.setProjectCd(accountingEntry.getProjectCd());
    newAccountingEntry.setOrgRefId(accountingEntry.getOrgRefId());
    newAccountingEntry.setAmount(accountingEntry.getAmount());
    return newAccountingEntry;
}
Also used : PdpFeedAccountingEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)

Example 2 with PdpFeedAccountingEntry

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

the class ConcurStandardAccountExtractPdpEntryServiceImpl method buildPdpFeedAccountingEntry.

@Override
public PdpFeedAccountingEntry buildPdpFeedAccountingEntry(ConcurAccountInfo concurAccountInfo) {
    PdpFeedAccountingEntry currentAccountingEntry = new PdpFeedAccountingEntry();
    currentAccountingEntry.setCoaCd(concurAccountInfo.getChart());
    currentAccountingEntry.setAccountNbr(concurAccountInfo.getAccountNumber());
    currentAccountingEntry.setSubAccountNbr(concurAccountInfo.getSubAccountNumber());
    currentAccountingEntry.setObjectCd(getConcurParameterValue(ConcurParameterConstants.CONCUR_SAE_PDP_DEFAULT_OBJECT_CODE));
    currentAccountingEntry.setSubObjectCd(StringUtils.EMPTY);
    currentAccountingEntry.setOrgRefId(concurAccountInfo.getOrgRefId());
    currentAccountingEntry.setProjectCd(concurAccountInfo.getProjectCode());
    currentAccountingEntry.setAmount(KualiDecimal.ZERO);
    return currentAccountingEntry;
}
Also used : PdpFeedAccountingEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)

Example 3 with PdpFeedAccountingEntry

use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry 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.rice.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 PdpFeedAccountingEntry

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

the class ConcurStandardAccountingExtractServiceImpl method getAccountingEntryForLine.

private PdpFeedAccountingEntry getAccountingEntryForLine(PdpFeedDetailEntry detailEntry, ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) {
    ConcurAccountInfo concurAccountInfo = buildConcurAccountInfoFromExtractDetailLine(line, concurStandardAccountingExtractFile);
    for (PdpFeedAccountingEntry accountingEntry : detailEntry.getAccounting()) {
        if (isCurrentAccountingEntrySameAsLineDetail(accountingEntry, concurAccountInfo)) {
            return accountingEntry;
        }
    }
    PdpFeedAccountingEntry accountingEntry = getConcurStandardAccountExtractPdpEntryService().buildPdpFeedAccountingEntry(concurAccountInfo);
    detailEntry.getAccounting().add(accountingEntry);
    return accountingEntry;
}
Also used : ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo) PdpFeedAccountingEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)

Example 5 with PdpFeedAccountingEntry

use of edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry 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.rice.core.api.util.type.KualiDecimal) PdpFeedGroupEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry) PdpFeedAccountingEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)

Aggregations

PdpFeedAccountingEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedAccountingEntry)11 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)5 PdpFeedDetailEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry)4 PdpFeedGroupEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedGroupEntry)2 ArrayList (java.util.ArrayList)2 PdpFeedTrailerEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedTrailerEntry)1 ConcurAccountInfo (edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)1 EnumMap (java.util.EnumMap)1