use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurDetailLineGroupForCollector method calculateTotalCashAmountNotOffsetByCashAdvances.
protected KualiDecimal calculateTotalCashAmountNotOffsetByCashAdvances() {
List<ConcurStandardAccountingExtractDetailLine> allCashLines = getSubGroupsOfType(ConcurSAECollectorLineType.CASH).stream().flatMap(List::stream).collect(Collectors.toCollection(ArrayList::new));
KualiDecimal totalCashAmount = calculateTotalAmountForLines(allCashLines);
KualiDecimal totalCashAdvanceAmount = calculateTotalAmountForCashAdvanceLinesReferencedByRegularLines(allCashLines);
return totalCashAmount.add(totalCashAdvanceAmount);
}
use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurDetailLineGroupForCollector method addOriginEntriesForCorpCardPersonalExpenseDebitLines.
protected void addOriginEntriesForCorpCardPersonalExpenseDebitLines(Consumer<OriginEntryFull> entryConsumer) {
if (getLineMapOfType(ConcurSAECollectorLineType.CORP_CARD_PERSONAL_DEBIT).isEmpty()) {
return;
}
KualiDecimal netCashAmount = calculateTotalCashAmountNotOffsetByCashAdvances();
KualiDecimal currentReimbursableCashAmount = netCashAmount;
for (List<ConcurStandardAccountingExtractDetailLine> corpCardPersonalDebits : getSubGroupsOfType(ConcurSAECollectorLineType.CORP_CARD_PERSONAL_DEBIT)) {
KualiDecimal totalSubGroupAmount = calculateTotalAmountForLines(corpCardPersonalDebits);
if (totalSubGroupAmount.isZero()) {
continue;
}
KualiDecimal newReimbursableCashAmount = currentReimbursableCashAmount.subtract(totalSubGroupAmount);
KualiDecimal paymentOffsetAdjustment = calculatePaymentOffsetAdjustmentForCorpCardPersonalExpenseSubGroup(totalSubGroupAmount, currentReimbursableCashAmount, newReimbursableCashAmount);
KualiDecimal personalOffsetAdjustment = calculatePersonalOffsetAdjustmentForCorpCardPersonalExpenseSubGroup(totalSubGroupAmount, currentReimbursableCashAmount, newReimbursableCashAmount);
addOriginEntriesForCorpCardPersonalExpenseDebitLinesIfNecessary(entryConsumer, corpCardPersonalDebits, paymentOffsetAdjustment, personalOffsetAdjustment);
currentReimbursableCashAmount = newReimbursableCashAmount;
}
}
use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurDetailLineGroupForCollector method buildOriginEntry.
protected OriginEntryFull buildOriginEntry(ConcurStandardAccountingExtractDetailLine detailLine, KualiDecimal amount) {
BiConsumer<OriginEntryFull, ConcurStandardAccountingExtractDetailLine> originEntryConfigurer;
if (collectorHelper.isCashAdvanceLine(detailLine)) {
originEntryConfigurer = getConfigurerForCashAdvanceOriginEntry(detailLine);
} else if (collectorHelper.isAtmFeeDebitLine(detailLine)) {
originEntryConfigurer = this::configureAtmFeeDebitOriginEntry;
} else {
originEntryConfigurer = this::configureRegularOriginEntry;
}
OriginEntryFull originEntry = buildOriginEntryWithoutAccountingIdentifiers(detailLine, amount);
originEntryConfigurer.accept(originEntry, detailLine);
return originEntry;
}
use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurDetailLineGroupForCollector method reportAllLinesForGroupAsFailuresDueToOrphanedCashAdvanceLines.
protected void reportAllLinesForGroupAsFailuresDueToOrphanedCashAdvanceLines(BiConsumer<ConcurStandardAccountingExtractDetailLine, String> lineErrorReporter) {
List<ConcurStandardAccountingExtractDetailLine> linesForGroup = getDetailLinesSortedBySequenceNumberNumerically();
Set<String> sequenceNumbersForOrphanedCashAdvanceLines = getSequenceNumbersForOrphanedCashAdvanceLines();
for (ConcurStandardAccountingExtractDetailLine detailLine : linesForGroup) {
String errorMessage;
if (sequenceNumbersForOrphanedCashAdvanceLines.contains(detailLine.getSequenceNumber())) {
errorMessage = collectorHelper.getFormattedValidationMessage(ConcurKeyConstants.CONCUR_SAE_ORPHANED_CASH_ADVANCE, detailLine.getCashAdvanceKey());
} else {
errorMessage = collectorHelper.getValidationMessage(ConcurKeyConstants.CONCUR_SAE_GROUP_WITH_ORPHANED_CASH_ADVANCE);
}
lineErrorReporter.accept(detailLine, errorMessage);
}
}
use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine in project cu-kfs by CU-CommunityApps.
the class ConcurDetailLineGroupForCollector method addOriginEntriesForCorpCardPersonalExpenseCreditLines.
protected void addOriginEntriesForCorpCardPersonalExpenseCreditLines(Consumer<OriginEntryFull> entryConsumer) {
if (getLineMapOfType(ConcurSAECollectorLineType.CORP_CARD_PERSONAL_CREDIT).isEmpty()) {
return;
}
for (List<ConcurStandardAccountingExtractDetailLine> corpCardPersonalCredits : getSubGroupsOfType(ConcurSAECollectorLineType.CORP_CARD_PERSONAL_CREDIT)) {
KualiDecimal totalSubGroupAmount = calculateTotalAmountForLines(corpCardPersonalCredits);
if (totalSubGroupAmount.isNonZero()) {
ConcurStandardAccountingExtractDetailLine firstCreditLine = corpCardPersonalCredits.get(0);
addOriginEntryForCorpCardPersonalExpense(entryConsumer, firstCreditLine, collectorHelper.getPrepaidOffsetChartCode(), collectorHelper.getPrepaidOffsetAccountNumber(), StringUtils.EMPTY, collectorHelper.getPrepaidOffsetObjectCode(), totalSubGroupAmount);
}
}
}
Aggregations