Search in sources :

Example 1 with DebitCreditTotal

use of edu.cornell.kfs.concur.batch.service.impl.ConcurStandardAccountExtractPdpEntryServiceImpl.DebitCreditTotal in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountExtractPdpEntryServiceImplTest method cleanAccountingEntriesInDetailEntry_HandleOneCredit.

@Test
public void cleanAccountingEntriesInDetailEntry_HandleOneCredit() {
    PdpFeedDetailEntry detailEntry = PdpFeedDetailEntryFixture.DETAIL_TWO_POSITIVE_1_NEGATIVE.toPdpFeedDetailEntry();
    Map<DebitCreditTotal, KualiDecimal> totals = pdpEntryService.calculateTotals(detailEntry);
    assertEquals("The number of accounting entries should be 3", 3, detailEntry.getAccounting().size());
    assertTotals(totals, 15, -10);
    pdpEntryService.cleanAccountingEntriesInDetailEntry(detailEntry);
    totals = pdpEntryService.calculateTotals(detailEntry);
    assertEquals("The number of accounting entries should be 1", 1, detailEntry.getAccounting().size());
    assertTotals(totals, 5, 0);
}
Also used : DebitCreditTotal(edu.cornell.kfs.concur.batch.service.impl.ConcurStandardAccountExtractPdpEntryServiceImpl.DebitCreditTotal) PdpFeedDetailEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) Test(org.junit.Test)

Example 2 with DebitCreditTotal

use of edu.cornell.kfs.concur.batch.service.impl.ConcurStandardAccountExtractPdpEntryServiceImpl.DebitCreditTotal in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountExtractPdpEntryServiceImplTest method cleanAccountingEntriesInDetailEntry_HandleTwoCredits.

@Test
public void cleanAccountingEntriesInDetailEntry_HandleTwoCredits() {
    PdpFeedDetailEntry detailEntry = PdpFeedDetailEntryFixture.DETAIL_TWO_POSITIVE_2_NEGATIVE.toPdpFeedDetailEntry();
    Map<DebitCreditTotal, KualiDecimal> totals = pdpEntryService.calculateTotals(detailEntry);
    assertEquals("The number of accounting entries should be 4", 4, detailEntry.getAccounting().size());
    assertTotals(totals, 15, -11);
    pdpEntryService.cleanAccountingEntriesInDetailEntry(detailEntry);
    totals = pdpEntryService.calculateTotals(detailEntry);
    assertEquals("The number of accounting entries should be 1", 1, detailEntry.getAccounting().size());
    assertTotals(totals, 4, 0);
}
Also used : DebitCreditTotal(edu.cornell.kfs.concur.batch.service.impl.ConcurStandardAccountExtractPdpEntryServiceImpl.DebitCreditTotal) PdpFeedDetailEntry(edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) Test(org.junit.Test)

Aggregations

DebitCreditTotal (edu.cornell.kfs.concur.batch.service.impl.ConcurStandardAccountExtractPdpEntryServiceImpl.DebitCreditTotal)2 PdpFeedDetailEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedDetailEntry)2 Test (org.junit.Test)2 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)2