Search in sources :

Example 6 with ConcurStandardAccountingExtractDetailLine

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);
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) ConcurStandardAccountingExtractDetailLine(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)

Example 7 with ConcurStandardAccountingExtractDetailLine

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;
    }
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) ConcurStandardAccountingExtractDetailLine(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)

Example 8 with ConcurStandardAccountingExtractDetailLine

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;
}
Also used : OriginEntryFull(org.kuali.kfs.gl.businessobject.OriginEntryFull) ConcurStandardAccountingExtractDetailLine(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)

Example 9 with ConcurStandardAccountingExtractDetailLine

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);
    }
}
Also used : ConcurStandardAccountingExtractDetailLine(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)

Example 10 with ConcurStandardAccountingExtractDetailLine

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);
        }
    }
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) ConcurStandardAccountingExtractDetailLine(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)

Aggregations

ConcurStandardAccountingExtractDetailLine (edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)19 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)8 Test (org.junit.Test)3 OriginEntryFull (org.kuali.kfs.gl.businessobject.OriginEntryFull)3 ConcurAccountInfo (edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)2 ConcurSAEDetailLineFixture (edu.cornell.kfs.concur.batch.fixture.ConcurSAEDetailLineFixture)1 ConcurBatchReportLineValidationErrorItem (edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)1 PdpFeedFileBaseEntry (edu.cornell.kfs.concur.batch.xmlObjects.PdpFeedFileBaseEntry)1 ArrayList (java.util.ArrayList)1