use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountingExtractCashAdvanceServiceImplTest method validateFindAccountingInfoForCashAdvanceLine.
@Test
public void validateFindAccountingInfoForCashAdvanceLine() {
List<ConcurStandardAccountingExtractDetailLine> saeLines = buildSAELines();
ConcurStandardAccountingExtractDetailLine line = ConcurSAEDetailLineFixture.PDP_TEST_CASH_ADVANCE_500.toDetailLine();
ConcurAccountInfo info = concurStandardAccountingExtractCashAdvanceService.findAccountingInfoForCashAdvanceLine(line, saeLines);
assertEquals("Charts should match", ParameterTestValues.COLLECTOR_CHART_CODE, info.getChart());
assertEquals("Accounts should match", ConcurTestConstants.ACCT_1234321, info.getAccountNumber());
}
use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountingExtractCashAdvanceServiceImplTest method validateIsCashAdvanceFalse.
@Test
public void validateIsCashAdvanceFalse() {
ConcurStandardAccountingExtractDetailLine line = ConcurSAEDetailLineFixture.PDP_TEST_DEBIT_1_50.toDetailLine();
assertFalse("Should NOT be a cash advance line", concurStandardAccountingExtractCashAdvanceService.isCashAdvanceLine(line));
}
use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountingExtractCollectorBatchBuilder method groupLines.
protected void groupLines(List<ConcurStandardAccountingExtractDetailLine> saeLines) {
for (ConcurStandardAccountingExtractDetailLine saeLine : saeLines) {
if (concurStandardAccountingExtractCashAdvanceService.isCashAdvanceLine(saeLine)) {
reportCashAdvance(saeLine);
}
if (shouldProcessLine(saeLine) && concurSAEValidationService.validateConcurStandardAccountingExtractDetailLineForCollector(saeLine, reportData)) {
if (Boolean.TRUE.equals(saeLine.getJournalAccountCodeOverridden())) {
reportPendingClientLine(saeLine);
}
ConcurDetailLineGroupForCollector lineGroup = lineGroups.computeIfAbsent(saeLine.getReportId(), (reportId) -> new ConcurDetailLineGroupForCollector(reportId, collectorHelper));
lineGroup.addDetailLine(saeLine);
}
}
}
use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurDetailLineGroupForCollector method buildOriginEntryForUnusedAtmAmountOffset.
protected OriginEntryFull buildOriginEntryForUnusedAtmAmountOffset(List<ConcurStandardAccountingExtractDetailLine> unusedAtmAmountLines, KualiDecimal amountToOffset) {
if (unusedAtmAmountLines.isEmpty()) {
throw new IllegalArgumentException("unusedAtmAmountLines list cannot be empty; this should NEVER happen!");
}
ConcurStandardAccountingExtractDetailLine firstUnusedAmountLine = unusedAtmAmountLines.get(0);
OriginEntryFull regularEntry = buildOriginEntryWithoutAccountingIdentifiers(firstUnusedAmountLine, amountToOffset);
configureOriginEntryFromDetailLineForAtmCashAdvance(regularEntry, firstUnusedAmountLine);
resetTransactionSequenceNumberCounterToPreviousValue();
OriginEntryFull offsetEntry = buildOffsetOriginEntry(regularEntry, amountToOffset);
offsetEntry.setChartOfAccountsCode(firstUnusedAmountLine.getReportChartOfAccountsCode());
offsetEntry.setAccountNumber(firstUnusedAmountLine.getReportAccountNumber());
offsetEntry.setSubAccountNumber(defaultToDashesIfBlank(firstUnusedAmountLine.getReportSubAccountNumber(), KFSPropertyConstants.SUB_ACCOUNT_NUMBER));
offsetEntry.setFinancialObjectCode(collectorHelper.getAtmUnusedAmountOffsetObjectCode());
offsetEntry.setFinancialSubObjectCode(collectorHelper.getDashOnlyPropertyValue(KFSPropertyConstants.SUB_OBJECT_CODE));
return offsetEntry;
}
use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurDetailLineGroupForCollector method addOriginEntriesForLines.
/**
* @param entryConsumer The Consumer to add the generated origin entries to; won't be called if detailLines is empty or has zero-sum lines.
* @param detailLines The SAE lines to generate a single origin entry from; may be empty.
* @param offsetGenerator A BiFunction that may create an offset entry using the generated regular entry and the detailLines List.
*/
protected void addOriginEntriesForLines(Consumer<OriginEntryFull> entryConsumer, List<ConcurStandardAccountingExtractDetailLine> detailLines, BiFunction<OriginEntryFull, List<ConcurStandardAccountingExtractDetailLine>, Optional<OriginEntryFull>> offsetGenerator) {
if (CollectionUtils.isEmpty(detailLines)) {
return;
}
KualiDecimal totalAmount = calculateTotalAmountForLines(detailLines);
if (totalAmount.isNonZero()) {
ConcurStandardAccountingExtractDetailLine firstDetailLine = detailLines.get(0);
OriginEntryFull originEntry = buildOriginEntry(firstDetailLine, totalAmount);
entryConsumer.accept(originEntry);
Optional<OriginEntryFull> optionalOffsetEntry = offsetGenerator.apply(originEntry, detailLines);
if (optionalOffsetEntry.isPresent()) {
entryConsumer.accept(optionalOffsetEntry.get());
}
}
}
Aggregations