Search in sources :

Example 1 with OriginEntryFull

use of org.kuali.kfs.gl.businessobject.OriginEntryFull in project cu-kfs by CU-CommunityApps.

the class ConcurDetailLineGroupForCollector method buildOriginEntryForPaymentOffset.

protected Optional<OriginEntryFull> buildOriginEntryForPaymentOffset(OriginEntryFull cashEntry, List<ConcurStandardAccountingExtractDetailLine> cashLines) {
    KualiDecimal cashAmount = getSignedAmountFromOriginEntry(cashEntry);
    KualiDecimal cashAdvanceAmount = calculateAndUpdateUsableAmountForCashAdvanceLinesReferencedByRegularLines(cashLines);
    KualiDecimal cashAmountToOffset = cashAmount.add(cashAdvanceAmount);
    if (cashAmountToOffset.isZero()) {
        return Optional.empty();
    }
    OriginEntryFull offsetEntry = buildOffsetOriginEntry(cashEntry, cashAmountToOffset);
    offsetEntry.setFinancialObjectCode(collectorHelper.getPaymentOffsetObjectCode());
    offsetEntry.setFinancialSubObjectCode(collectorHelper.getDashOnlyPropertyValue(KFSPropertyConstants.SUB_OBJECT_CODE));
    return Optional.of(offsetEntry);
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) OriginEntryFull(org.kuali.kfs.gl.businessobject.OriginEntryFull)

Example 2 with OriginEntryFull

use of org.kuali.kfs.gl.businessobject.OriginEntryFull in project cu-kfs by CU-CommunityApps.

the class ConcurDetailLineGroupForCollector method addOriginEntryForCorpCardPersonalExpense.

protected void addOriginEntryForCorpCardPersonalExpense(Consumer<OriginEntryFull> entryConsumer, ConcurStandardAccountingExtractDetailLine detailLine, String chartCode, String accountNumber, String subAccountNumber, String objectCode, KualiDecimal amount) {
    OriginEntryFull originEntry = buildCorpCardPersonalExpenseOriginEntry(detailLine, chartCode, accountNumber, subAccountNumber, objectCode, StringUtils.EMPTY, amount);
    entryConsumer.accept(originEntry);
}
Also used : OriginEntryFull(org.kuali.kfs.gl.businessobject.OriginEntryFull)

Example 3 with OriginEntryFull

use of org.kuali.kfs.gl.businessobject.OriginEntryFull in project cu-kfs by CU-CommunityApps.

the class ConcurDetailLineGroupForCollector method addOffsetOriginEntriesForUnusedAtmCashAdvanceAmountLines.

protected void addOffsetOriginEntriesForUnusedAtmCashAdvanceAmountLines(Consumer<OriginEntryFull> entryConsumer, List<ConcurStandardAccountingExtractDetailLine> unusedAtmAmountLines) {
    if (CollectionUtils.isEmpty(unusedAtmAmountLines)) {
        return;
    }
    KualiDecimal totalAmount = calculateTotalAmountForLines(unusedAtmAmountLines);
    if (totalAmount.isNonZero()) {
        OriginEntryFull offsetEntry = this.buildOriginEntryForUnusedAtmAmountOffset(unusedAtmAmountLines, totalAmount);
        entryConsumer.accept(offsetEntry);
    }
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) OriginEntryFull(org.kuali.kfs.gl.businessobject.OriginEntryFull)

Example 4 with OriginEntryFull

use of org.kuali.kfs.gl.businessobject.OriginEntryFull in project cu-kfs by CU-CommunityApps.

the class ConcurDetailLineGroupForCollector method buildOriginEntryWithoutAccountingIdentifiers.

protected OriginEntryFull buildOriginEntryWithoutAccountingIdentifiers(ConcurStandardAccountingExtractDetailLine detailLine, KualiDecimal amount) {
    OriginEntryFull originEntry = new OriginEntryFull();
    // Default constructor sets fiscal year to zero; need to forcibly clear it to allow auto-setup by the Poster, as per the spec.
    originEntry.setUniversityFiscalYear(null);
    originEntry.setFinancialBalanceTypeCode(collectorHelper.getActualFinancialBalanceTypeCode());
    originEntry.setFinancialDocumentTypeCode(collectorHelper.getDocumentTypeCode());
    originEntry.setFinancialSystemOriginationCode(collectorHelper.getSystemOriginationCode());
    originEntry.setDocumentNumber(buildDocumentNumber(detailLine));
    originEntry.setTransactionLedgerEntryDescription(buildTransactionDescription(detailLine));
    originEntry.setTransactionDate(collectorHelper.getTransmissionDate());
    setTransactionSequenceNumberToNextAvailableValue(originEntry);
    configureAmountAndDebitCreditCodeOnOriginEntry(originEntry, amount);
    return originEntry;
}
Also used : OriginEntryFull(org.kuali.kfs.gl.businessobject.OriginEntryFull)

Example 5 with OriginEntryFull

use of org.kuali.kfs.gl.businessobject.OriginEntryFull in project cu-kfs by CU-CommunityApps.

the class ConcurDetailLineGroupForCollector method buildOriginEntryForCorporateCardOffset.

protected Optional<OriginEntryFull> buildOriginEntryForCorporateCardOffset(OriginEntryFull corporateCardEntry, List<ConcurStandardAccountingExtractDetailLine> corporateCardLines) {
    KualiDecimal corporateCardAmount = getSignedAmountFromOriginEntry(corporateCardEntry);
    OriginEntryFull offsetEntry = buildOffsetOriginEntry(corporateCardEntry, corporateCardAmount);
    offsetEntry.setChartOfAccountsCode(collectorHelper.getPrepaidOffsetChartCode());
    offsetEntry.setAccountNumber(collectorHelper.getPrepaidOffsetAccountNumber());
    offsetEntry.setSubAccountNumber(collectorHelper.getDashOnlyPropertyValue(KFSPropertyConstants.SUB_ACCOUNT_NUMBER));
    offsetEntry.setFinancialObjectCode(collectorHelper.getPrepaidOffsetObjectCode());
    offsetEntry.setFinancialSubObjectCode(collectorHelper.getDashOnlyPropertyValue(KFSPropertyConstants.SUB_OBJECT_CODE));
    return Optional.of(offsetEntry);
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) OriginEntryFull(org.kuali.kfs.gl.businessobject.OriginEntryFull)

Aggregations

OriginEntryFull (org.kuali.kfs.gl.businessobject.OriginEntryFull)20 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)6 FatalErrorException (org.kuali.kfs.gl.batch.service.impl.exception.FatalErrorException)5 ObjectCode (org.kuali.kfs.coa.businessobject.ObjectCode)4 ConcurStandardAccountingExtractDetailLine (edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractDetailLine)3 List (java.util.List)3 InvalidFlexibleOffsetException (org.kuali.kfs.sys.exception.InvalidFlexibleOffsetException)3 IOException (java.io.IOException)2 Message (org.kuali.kfs.sys.Message)2 ReversionCategory (edu.cornell.kfs.coa.businessobject.ReversionCategory)1 ReversionCategoryInfo (edu.cornell.kfs.coa.businessobject.ReversionCategoryInfo)1 ReversionUnitOfWork (edu.cornell.kfs.gl.businessobject.ReversionUnitOfWork)1 ReversionUnitOfWorkCategoryAmount (edu.cornell.kfs.gl.businessobject.ReversionUnitOfWorkCategoryAmount)1 BigDecimal (java.math.BigDecimal)1 Date (java.sql.Date)1 Timestamp (java.sql.Timestamp)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 A21SubAccount (org.kuali.kfs.coa.businessobject.A21SubAccount)1